Your Data · Attack Surface

list_my_ports

List ports across your assets with host, IP and detected service. Filter by state (e.g. "open"), port number, protocol, or host (hostname/FQDN/IP substring). Costs 1 credit.

POST
tools/call

Cost: 1 credit per successful call  ·  Scope: mcp:org  ·  Response shape: jsonb

Returns data scoped to your own organisation only — the organisation is resolved from your API key and injected server-side, never read from the request.

Parameters

statestringoptional

Filter by port state, e.g. open, closed, filtered. Optional.

portintegeroptional

Filter by port number. Accepted range: 1–65535. Optional.

protocolstringoptional

Filter by transport protocol, e.g. tcp, udp. Optional.

hoststringoptional

Filter by host as a hostname, FQDN, or IP substring. Maximum 255 characters. Optional.

limitintegeroptionaldefault: 100

Maximum number of ports to return. Accepted range: 1–500.

Example invocation

Ask your agent: "List all our open ports."

curl -s https://api.precursorintelligence.com/functions/v1/mcp \
  -H "Authorization: Bearer $PRECURSOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_my_ports","arguments":{"state":"open","limit":100}}}'

Response

result.content[0].text (parsed)
{
  "count": 3,
  "items": [
    {
      "hostname": "autodiscover",
      "fqdn": "autodiscover.precursorsecurity.com",
      "ip": "40.99.153.136",
      "port_number": 443,
      "protocol": "tcp",
      "state": "open",
      "service_name": "https",
      "service_product": "Microsoft IIS httpd",
      "service_version": "10.0"
    },
    {
      "hostname": "autodiscover",
      "fqdn": "autodiscover.precursorsecurity.com",
      "ip": "40.99.153.136",
      "port_number": 80,
      "protocol": "tcp",
      "state": "open",
      "service_name": "http",
      "service_product": "Microsoft IIS httpd",
      "service_version": "10.0"
    },
    {
      "hostname": "mail",
      "fqdn": "mail.precursorsecurity.com",
      "ip": "203.0.113.10",
      "port_number": 22,
      "protocol": "tcp",
      "state": "open",
      "service_name": "ssh",
      "service_product": "OpenSSH",
      "service_version": "8.9p1"
    }
  ],
  "generated_at": "2026-06-18T08:15:00.000Z"
}

The full MCP envelope, including _meta.precursor with request_id, credits, and response_truncated, is documented in Response Format.

Response fields

countintegeroptional

Number of ports returned (equals items.length).

itemsarrayoptional

Ports matching the filters within your organisation. Each object contains the fields below.

items[].hostnamestringoptional

Short hostname of the asset.

items[].fqdnstringoptional

Fully qualified domain name of the asset.

items[].ipstringoptional

IP address the port was observed on, e.g. 40.99.153.136.

items[].port_numberintegeroptional

Port number, e.g. 443.

items[].protocolstringoptional

Transport protocol, e.g. tcp, udp.

items[].statestringoptional

Port state from the most recent scan, e.g. open.

items[].service_namestring | nulloptional

Detected service name, e.g. https, ssh.

items[].service_productstring | nulloptional

Detected service product, e.g. Microsoft IIS httpd, OpenSSH.

items[].service_versionstring | nulloptional

Detected service version, e.g. 10.0.

generated_atstringoptional

ISO 8601 timestamp indicating when this response was generated.

Errors

CodeMessageWhen
-32602invalid_params: port: min:1port is less than 1
-32602invalid_params: port: max:65535port exceeds 65535
-32602invalid_params: host: max:255host exceeds 255 characters
-32602invalid_params: limit: min:1limit is less than 1
-32602invalid_params: limit: max:500limit exceeds 500
-32001unauthorizedThe API key is invalid/revoked, the IP is not allowed, or the key lacks the mcp:org scope.
-32002insufficient_creditsYour credit balance is zero; top up from the dashboard
-32603internalUnexpected server error; the credit is automatically refunded