Skip to main content
Glama

get_network_connections

Fetch TCP/UDP socket states, addresses, and process details from Linux. Filter by status or type, group by PID, and optionally resolve hostnames.

Instructions

Returns TCP/UDP sockets with state, addresses, process info, and optional reverse-DNS hostnames. Read-only from /proc/net. Params: status and type filters, grouped by PID, max_connections (0-200). resolve_hostnames does network lookups and is slow - keep it off unless needed. For listening sockets pass status=LISTEN; process names are included.

Input Schema

NameRequiredDescriptionDefault
typeNooptional type filter: tcp, udp
statusNooptional status filter (e.g. ESTABLISHED, LISTEN, TIME_WAIT)
groupedNooptional: group connections by PID (default: false)
max_connectionsNooptional: limit results (max: 200)
resolve_hostnamesNooptional: resolve remote hostnames via reverse DNS (default: false)

Output Schema

NameRequiredDescriptionDefault
errorsNo
groupsNo
connectionsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the safety burden and does so well: it declares 'Read-only from /proc/net' and warns that resolve_hostnames performs slow network lookups. It does not disclose truncation/default behavior for max_connections or how results behave under the 200 cap.

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

Conciseness4/5

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

Front-loads the core purpose and the read-only guarantee, then packs filters and caveats economically in three sentences. The trailing 'process names are included' is slightly redundant given the output schema, but overall there is little waste.

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?

For a read-only inspection tool with 5 optional params, full schema coverage, and an output schema covering return values, the description supplies what's missing: safety profile, latency caveat, and filter usage. Nothing an agent needs in order to call it correctly is absent.

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 an extra point by adding meaning the schema lacks – the cost/latency of resolve_hostnames and the listening-socket use of status=LISTEN. The rest ('status and type filters, grouped by PID, max_connections') largely paraphrases the schema.

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?

States a specific verb and resource ('Returns TCP/UDP sockets') with the key returned fields (state, addresses, process info), which cleanly separates it from siblings like get_network_info, get_ip_info and get_routing_table. An agent can identify the tool's domain without opening the schema.

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 concrete conditional guidance: 'For listening sockets pass status=LISTEN' and 'resolve_hostnames ... keep it off unless needed.' That covers the main decision points, but it never contrasts itself with adjacent tools (e.g. get_network_info, get_process_fds) or states when this tool is the wrong choice.

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