Skip to main content
Glama

process_tree

Show a process's ancestors and all descendants as a tree before killing it, so you can see which parent may restart a child and which processes listen on ports.

Instructions

Show a process's ancestors (who started it) and all its descendants, as a tree.

Each node lists name, PID and a shortened command line, and marks processes that are listening on a port. Use it before killing: killing a child can be undone by its parent restarting it (npm, nodemon, a reloader, a service manager).

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": {
      "pid": "<pid>"
    },
    "name": "process_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
pidYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does well: it states the per-node fields (name, PID, shortened command line) and that listening processes are flagged, and it discloses the non-obvious behavioral hazard that killing a child may be undone by its parent. It is implicitly read-only via 'Show' but never says so outright.

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?

Two short blocks, front-loaded with the core purpose, then the payload contents, then the one actionable caveat. No filler or restated metadata.

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 single-parameter read tool with an output schema, this is nearly complete: purpose, output shape, and the practical warning are all covered. The only gap is an explicit statement of what the pid argument selects.

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?

The schema has zero description coverage for the single required 'pid' parameter, so the description must compensate. It implies that the tree is rooted at the given process ('a process's ancestors and descendants'), but never explicitly says the argument is the focal PID, so the mapping is inferable rather than stated.

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?

The description names a specific verb and resource ('Show a process's ... as a tree') and defines the exact scope: ancestors plus all descendants. That scope is clearly distinct from the port-oriented siblings like kill_port or list_listening, so an agent can route correctly 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?

It gives an explicit trigger ('Use it before killing') and justifies it with a concrete failure mode: a parent restarting a killed child (npm, nodemon, reloader, service manager). It stops short of naming kill_port as the alternative, but the usage context is unambiguous.

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