Skip to main content
Glama

list_ports

Read-onlyIdempotent

List listening TCP and UDP ports with owning processes to identify why a port is occupied or a service is not listening.

Instructions

Read-only list of listening TCP and bound UDP ports and, when visible, owning processes. Use to diagnose an occupied port or a service that is not listening. Ownership depends on OS permissions; no processes are modified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNo

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?

Annotations already establish readOnly, idempotent, and non-destructive behavior. The description adds meaningful context beyond that: ownership visibility depends on OS permissions, and no processes are modified. This informs the agent about environment-dependent output without contradicting 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?

The description is two compact sentences. The core purpose and read-only nature are front-loaded, and the use case and permission caveat follow without unnecessary detail. Every sentence adds distinct value.

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?

For a simple read-only listing tool with no output schema, the description covers what is listed, when to use it, and a key platform-dependent limitation. The only notable gap is the undocumented port filtering parameter, which an agent would need to know to target a specific port.

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

Parameters2/5

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

Schema description coverage is 0%, and the description does not mention the optional 'port' parameter or explain that it likely filters results to a specific port. The schema only provides type and range constraints, leaving the parameter's purpose and behavior undocumented. A single optional parameter is simple, but the description still fails to clarify how it affects the returned list.

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?

The description clearly states the action ('list') and the resources ('listening TCP and bound UDP ports' and 'owning processes'). It also specifies scope conditions like 'when visible,' making the tool's purpose unambiguous and distinct from a generic process listing.

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?

The description explicitly says 'Use to diagnose an occupied port or a service that is not listening,' which gives a concrete trigger for when to call the tool. It stops short of naming when not to use it or contrasting it with the sibling list_processes, so no exclusions are provided, but context is clear.

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