Skip to main content
Glama
safe-ssh-mcp

safe-ssh-mcp

by Areso

get_tcp_connections

Read-only

List individual TCP sockets filtered by connection state or local/peer port, showing owning processes on a remote host so you can identify who holds each connection.

Instructions

Individual TCP sockets (ss -tanp), filtered by state and tcp_port (local or peer): who holds what get_socket_summary counted.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "host": "<host>",
      "user": "<user>"
    },
    "name": "get_tcp_connections"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostYes
portNo
userYes
linesNo
stateNo
timeoutNo
key_pathNo
tcp_portNo
password_envNo
accept_new_hostkeyNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.4.0
    • removedInput schema / properties / password
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null
      -}
    • addedInput schema / properties / password_env
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • changedInput schema / properties / state / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "all",
      +      "established",
      +      "syn-sent",
      +      "syn-recv",
      +      "fin-wait-1",
      +      "fin-wait-2",
      +      "time-wait",
      +      "close-wait",
      +      "last-ack",
      +      "closing",
      +      "listening"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Addedv0.3.3

TDQS

C2.9/5.0
Behavior2/5

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

Annotations only declare readOnlyHint=true. Beyond that, the description reveals the underlying command (ss -tanp), which hints at a remote shell execution, but it never states that the call connects to another host via SSH, that -p normally requires root to show owning processes, or how the lines/timeout options limit output. For a 10-parameter remote-execution tool, this is thin.

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?

A single compact sentence with the resource and filters front-loaded before the sibling reference. It is efficient, though the compressed final clause is slightly opaque on first read.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value explanation is not required, but with 10 undocumented parameters, only a readOnlyHint annotation, and SSH connectivity implied yet never described, an agent cannot confidently construct the call. The definition is materially incomplete for a tool of this complexity.

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 coverage is 0% across 10 parameters, so the description must carry the burden, yet it only addresses state and tcp_port (noting local-or-peer matching). Crucial connection parameters (host, user, port defaulting to 22, key_path, password_env, accept_new_hostkey) and output-limiting parameters (lines, timeout) get no explanation at all.

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 names the specific resource (individual TCP sockets) and the underlying command (ss -tanp), and explicitly frames the tool as the per-entry counterpart to get_socket_summary's aggregation. The trailing phrasing 'who holds what get_socket_summary counted' is a little cryptic but still conveys the summary-vs-detail distinction.

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?

Usage is implied through the relationship to get_socket_summary (drill down from counts to individual sockets), and the state/tcp_port filters hint at narrowing results. There is no explicit statement of when to prefer this over the summary tool or any preconditions such as requiring elevated privileges to see process owners.

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