Skip to main content
Glama

whats_on_port

Identifies every process listening on a given port, including PID, command line, framework, bind address, and process tree, and checks whether the port is free or reserved.

Instructions

Answer "what is using port N?" in detail.

Returns every listener on the port: PID, process name, user, full command line, working directory, the inferred framework, the address it is bound to (and whether that exposes it to the network), the process's parent and children, and whether kill_port would refuse it (system process, your own MCP client). If nothing is listening it says so, and also checks whether the port can be bound, which catches OS-reserved ports (Windows excluded ranges) and listeners hidden by missing privileges.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "port": "<port>"
    },
    "name": "whats_on_port"
  }
}

Input Schema

NameRequiredDescriptionDefault
portYes
protocolNotcp

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so well: it discloses the full result payload, the kill_port refusal classification (system process, own MCP client), and the negative case (nothing listening, plus a bind test catching OS-reserved ranges and privilege-hidden listeners). It never states outright that the tool is read-only and performs no termination, which an agent must infer from the kill_port cross-reference.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the question it answers, then a single dense enumeration sentence. The long field list is information-rich rather than padding, though it could be tightened into a shorter clause without losing meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers edge cases (no listener, OS-reserved ports, privilege-hidden listeners) and the kill_port interaction, which is the right scope for a diagnostic tool. The one real hole is the undocumented protocol parameter; return-value detail is arguably redundant given an output schema exists but costs little.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. The 'port' parameter's meaning is self-evident from the framing, but 'protocol' (default tcp) is never mentioned at all, leaving an agent unaware it can query UDP listeners or that TCP is the default scope.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific question it answers ("what is using port N?") and enumerates exactly what comes back (PID, process, user, command line, cwd, framework, bind address, parent/children, kill_port refusal). This is clearly distinct from list_listening and check_port_reachable, which do not claim per-port process forensics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is clear: diagnosing what occupies a specific port, and it explicitly ties into the kill_port workflow by reporting whether kill_port would refuse the process. It does not explicitly exclude or route to siblings like list_listening or check_port_reachable, which is why this is a 4 rather than a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.