Skip to main content
Glama

port_info

Identify which dev server is using a specific TCP port, or confirm if the port is free. Resolve port conflicts quickly.

Instructions

Get info on a specific port. Returns the dev server holding it, or null if free / not a dev process.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portYesTCP port number

Implementation Reference

  • Tool registration and input schema for 'port_info' — defines the tool name, description, and expected input (port number).
    {
      name: "port_info",
      description: "Get info on a specific port. Returns the dev server holding it, or null if free / not a dev process.",
      inputSchema: {
        type: "object",
        properties: { port: { type: "number", description: "TCP port number" } },
        required: ["port"],
        additionalProperties: false,
      },
    },
  • Handler for the 'port_info' tool — parses the port argument, calls portInfo(), and returns the result or a 'free' status.
    case "port_info": {
      const port = z.number().int().parse((args as any)?.port);
      const data = await portInfo(port);
      return ok(data ?? { port, status: "free" });
  • Core implementation of portInfo() — calls listDevServers() to get all dev servers and filters by the given port.
    export async function portInfo(port: number): Promise<DevServer | null> {
      const all = await listDevServers();
      return all.find((s) => s.port === port) ?? null;
    }
  • DevServer type definition (port, pid, process, framework, uptime, etc.) — the return shape of portInfo.
    export interface DevServer {
      port: number;
      pid: number;
      process: string;
      cmdline: string;
      cwd: string | null;
      project_name: string | null;
      framework: string | null;
      uptime_seconds: number;
      memory_mb: number;
      cpu_pct: number;
      user: string;
    }
Behavior3/5

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

No annotations provided, so description carries full burden. Discloses read-only nature and two possible return states. However, does not mention error behavior or permissions, leaving some behavioral gaps.

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?

Single sentence with no wasted words. Front-loaded with action and resource, efficiently conveying purpose and return type.

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 tool with one parameter and no output schema, description covers purpose and return value sufficiently. Minor gap: could hint at structure of returned dev server object, but not critical.

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 coverage is 100% and description does not add semantic meaning beyond 'TCP port number' already in schema. Baseline score of 3 applies as no additional value provided.

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?

Description clearly states action ('Get info') and resource ('specific port'), and distinguishes itself by mentioning return value (dev server or null) which differentiates from siblings like 'port_conflict' or 'kill_server'.

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

Usage Guidelines3/5

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

Implied usage (check what holds a port) but lacks explicit guidance on when to use this vs alternatives like 'port_conflict' or 'list_dev_servers'. No exclusions or when-not-to-use mentioned.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HasanJahidul/localhost-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server