get_process_tree
Shows a process tree with parent-child hierarchy and depth information, enabling you to trace spawned children and understand process relationships. Optionally filter to a specific PID's subtree.
Instructions
Returns a flat process list with depth info showing parent-child hierarchy. Read-only from /proc//stat and /proc//comm. When pid is omitted, returns all processes rooted at init (ppid 0). When pid is provided, returns only that subtree. Invalid or missing PIDs return empty nodes with no error. Use to understand process hierarchy and trace spawned children; for per-process resource usage prefer get_process_info.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | No | optional PID to show subtree from (omit for full tree) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodes | Yes | ||
| total | Yes | ||
| errors | No | ||
| filtered | No |