call_graph
Generates a Mermaid flowchart of call relationships in a Python file or package. Optionally roots the graph at a specific function, adjusts direction, and includes external calls.
Instructions
Emit a Mermaid flowchart of the call relationships in a file or package.
Args: path: Path to a .py file. function: Optional root; only calls reachable from it are drawn. direction: Mermaid layout direction: TD, TB, LR, RL or BT. include_external: Include calls to names not defined in scope. scope: "file" (default) or "package" to walk every .py file in the containing directory.
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": {
"path": "<path>"
},
"name": "call_graph"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| scope | No | file | |
| function | No | ||
| direction | No | TD | |
| include_external | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |