Skip to main content
Glama

Local Connections

local_connections

Show active TCP/UDP network connections and listening ports with local/remote addresses and state. Filter by all, listen, or established to diagnose network activity.

Instructions

Show active network connections and listening ports.

Displays TCP/UDP sockets with local/remote addresses and state. Uses ss on Linux (netstat as a fallback) and netstat on macOS and Windows. ss filters by state natively; netstat on macOS, Windows and older Linux has no state filter, so for 'listen' and 'established' this tool filters the output lines itself after the command runs and says so in the note field. Does not require admin privileges (PIDs may require admin).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateNoWhich sockets to show: 'all' (default), 'listen' (listening TCP ports only) or 'established' (connected TCP sessions only).all

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNoAdditional context about the result
errorNoWhy the tool could not produce a result: input validation failure, tool disabled by configuration, binary not installed, or no service answered. Empty when the command executed.
stderrYesStandard error of the command, or the failure message when the command did not run
stdoutYesStandard output of the command (curl output is capped at 10,000 characters)
commandYesThe exact command line that was executed, or the tool name if the command never ran
successYesTrue when the command ran and exited with status 0
platformYesOperating system the command ran on (Darwin, Linux or Windows)
returncodeYesProcess exit status. 0 = success; 2 = input rejected before running; 124 = timed out; 126 = disabled by config or permission denied; 127 = binary not found

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full behavioral disclosure burden. It explains the underlying commands (ss on Linux, netstat fallback), reveals that state filtering is done post-processing when netstat lacks native support, mentions the note field, and flags the admin privilege caveat for PIDs. This is rich and honest context beyond the schema.

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 front-loaded with the core purpose, and every additional sentence covers a distinct necessary behavior: command selection by OS, state-filter mechanics, note-field behavior, and privilege requirements. There is no filler or repetition.

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?

With one optional parameter and an output schema already present, the description covers all non-obvious behavior an agent needs: OS differences, fallback command behavior, filtering approach, note field, and permission caveats. Nothing important is missing for correct invocation or interpretation.

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% and the single optional enum parameter is already well described, so the baseline is 3. The description adds value by explaining how the state filter behaves differently per platform and that the tool filters output itself when the underlying command cannot, recording this in the note field.

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?

The description states a specific verb and resource: 'Show active network connections and listening ports' and explicitly says it displays TCP/UDP sockets with local/remote addresses and state. It is unambiguous, but it does not explicitly differentiate itself from sibling tools like local_netstat_stats or local_interfaces.

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 first sentence clearly establishes the use case: inspecting active network connections and listening ports. It also provides practical context about platform-specific command behavior and the admin privilege caveat. However, it does not explicitly compare with sibling tools or state when-not-to-use, so it stops short of a 5.

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