Skip to main content
Glama
GeminiDesk MCP
by LZ7TOP

List Listening Ports & Network Connections

services_list_ports

Lists currently open listening network ports and the processes using them via lsof, with filters by port, process name, user, or PID. Use it to inspect which services are listening on a local machine.

Instructions

查看电脑当前开放监听的网络端口与占用进程(基于 lsof)。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "services_list_ports"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo最大返回条目数
filterNo按端口号、进程名、用户名或 PID 过滤
listeningOnlyNo是否仅显示 LISTEN 状态的监听端口

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does communicate two useful facts by implication: the operation is a read-only inspection (查看) and results depend on lsof being available on the host. However it omits whether elevated privileges are needed to see other users' processes, whether the output is a point-in-time snapshot, and any cost/size characteristics, so the behavioral picture is only partly covered.

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?

One short sentence with the resource front-loaded and no filler; the parenthetical about lsof is a compact, informative addition. Sized appropriately for a simple three-optional-parameter read tool.

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

Completeness3/5

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

For a low-complexity read tool with no required parameters and no output schema, the description covers what is returned (ports plus occupying processes) at a high level. It is still thin on privilege caveats and on the fact that filter/listeningOnly control scope, which an agent would only learn from the schema.

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 limit, filter and listeningOnly are already fully documented in the input schema; the description adds no syntax, format, or interaction detail beyond it. Baseline 3 applies. It even slightly undersells listeningOnly by framing the tool as listening-only when the schema allows disabling that.

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 (查看/list) and resource (open listening network ports plus the processes holding them), and even names the underlying mechanism (lsof). That distinguishes it from siblings like services_list_processes, though the description omits the 'network connections' scope implied by the title, leaving a small ambiguity about whether only LISTEN sockets are returned.

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?

The purpose implies the use case (diagnosing what is bound to which port and by which process), but the description never states when to prefer it over services_list_processes or services_list_dev, nor any exclusions. Usage must be inferred entirely from the verb+resource phrase.

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