Skip to main content
Glama

list_ports

Read-onlyIdempotent

List local listening ports with their processes, PIDs, users, and Docker/Podman containers; filter by process glob, port range, or TCP/UDP to identify running services and dev servers.

Instructions

List the ports listening on this machine, with the process, PID, user and who started it (e.g. npm ← zsh), and the container for ports published by Docker or Podman. Use it to see what's running, or to find a dev server by name (name="node*") or port range.

Input Schema

NameRequiredDescriptionDefault
nameNoonly processes whose name matches this glob, e.g. node*
portsNoonly these local ports, e.g. 3000 or 3000-3010,8080
protoNotcp or udp (default both)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive, and openWorldHint=false, so the safety profile is covered. The description adds real value beyond that by disclosing the returned fields (process, PID, user, launcher chain like 'npm ← zsh', container name) and that Docker/Podman-published ports are included — context an agent cannot get from the annotations.

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

Conciseness5/5

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

Two sentences, no filler: the first defines the output payload, the second routes usage. The output detail is front-loaded where it matters most, and no sentence merely restates the tool name.

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

Completeness5/5

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

There is no output schema, and the description compensates by enumerating the returned fields and noting container coverage. With all three parameters fully documented in the schema and a safe read-only annotation set, an agent has everything needed to call this correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description earns a bump by tying name to a concrete glob example ('node*') and ports to a range form, framing both as discovery aids. It adds nothing for proto, which the schema already documents as 'tcp or udp (default both)'.

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

Purpose4/5

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

A specific verb (List) plus resource (ports listening on this machine) with an explicit inventory of what each entry contains: process, PID, user, parent shell, and container. It never names the sibling tools (check_port, find_free_port, wait_for_port), so differentiation is inferred from the word 'List' rather than stated.

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?

Gives two concrete use cases: 'see what's running' and 'find a dev server by name (name="node*") or port range', which maps directly onto the name and ports parameters. It stops short of exclusions, e.g. it never says to use check_port for a single known port or find_free_port when you need an available port.

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