Skip to main content
Glama

check_port

Read-onlyIdempotent

Check whether ports are free and identify the process holding any in-use port, with name, PID, user, command, and container. Use first when a server reports address already in use or EADDRINUSE.

Instructions

Check whether ports are free. For each port in use, says which process holds it: name, PID, user, command line, who started it, and the container if Docker or Podman publishes it. Use it first when a server fails with "address already in use" or EADDRINUSE.

Input Schema

NameRequiredDescriptionDefault
portsYesthe ports to check, e.g. [3000]
protoNotcp (default) or udp

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / ports / minItems
      Added value: +1
    • changedInput schema / properties / ports / type
      Previous value: -[
      -  "null",
      -  "array"
      -]New value: +"array"
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare the safe read-only, idempotent, local-only profile, and the description adds real value beyond them: it specifies exactly what is returned per in-use port, including the container publisher when Docker or Podman is involved. It does not cover behavior for free ports or any output shape, but with no output schema the process-attribution detail is the load-bearing information.

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?

Three sentences, each earning its place: what it does, what it returns, and when to reach for it. The trigger condition is front-loaded at the end as a decisive call to action with no filler.

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?

With no output schema and only annotations for safety metadata, the description carries the return-value burden and does so well by enumerating the per-port diagnostic fields. The one gap is that it never explains what the result looks like for a free port or references the TCP/UDP dimension.

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 100%, so both parameters are already documented in the schema and the baseline applies. The description adds nothing about the proto parameter (tcp/udp default) or the array-of-ports input beyond the plural 'ports', so it neither compensates nor detracts.

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?

States a specific verb+resource (check ports, report the owning process with name, PID, user, command line, and container). That process-attribution detail implicitly separates it from find_free_port and list_ports, but the description never names those siblings, so the differentiation is inferred 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 a concrete trigger: 'Use it first when a server fails with "address already in use" or EADDRINUSE.' That is a clear when-to-use signal. It stops short of routing the agent elsewhere — nothing says to use find_free_port when you want an available port or list_ports for enumeration.

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