Skip to main content
Glama

get_process_tree

Read-onlyIdempotent

Retrieve a process tree showing parent-child relationships with CPU and private memory for a given process or the whole machine, excluding exited parents and false links from reused PIDs.

Instructions

The process tree: who started whom, with CPU and private memory, from a process down (or the whole machine). Parents that exited are left out; a reused PID does not make a false parent.

Input Schema

NameRequiredDescriptionDefault
pidNoThe process at the top; the whole machine when left out.
depthNoLevels below the top (default 6, at most 20).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so safety needs no restating. The description instead adds real behavioral context the annotations cannot: exited parents are omitted from the tree, PID reuse is guarded against so no false parent is reported, and the payload carries CPU and private memory figures.

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 tight sentences: the payload and scope come first, then the correctness caveats. Nothing is repeated and every clause carries information an agent would otherwise have to guess.

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?

With no output schema, the description does the necessary work of naming the returned fields and the tree semantics, and the schema handles depth limits. The one unresolved gap is output shape (nested tree versus flat rows with parent ids) and ordering, which would matter when reasoning over the result.

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 coverage is 100% and both parameters are documented in the schema, including depth's default of 6 and cap of 20, so the baseline of 3 applies. The description's 'from a process down (or the whole machine)' mirrors the pid semantics rather than adding syntax or edge-case detail beyond it.

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 the resource and its distinctive shape: a parent-child process tree with CPU and private memory, rooted either at a given process or the whole machine. That implicitly separates it from flat-list siblings like list_processes and single-record get_process, but it never names an alternative, so differentiation is inferable rather than explicit.

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 by the scoping phrase 'from a process down (or the whole machine)', which hints at when to pass a pid versus omit it. There is no explicit when-to-use guidance, no when-not, and no pointer to get_wait_chain or get_process for other lineage questions.

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