treesitter_get_call_graph
Generate a call graph for a source file, mapping function calls and their relationships to reveal code structure and dependencies.
Instructions
Generate a call graph showing function calls and their relationships.
Args: file_path: Path to the source code file output_file: If provided, writes result to this file instead of returning. Useful for large outputs to prevent context overload.
Returns: Dictionary containing: - nodes: List of CallGraphNode objects, each with: - name: Function name - location: Source location (start/end points) - calls: List of function names called by this function OR if output_file is set: {"status": "written", "output_file": "...", "bytes_written": N}
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": {
"file_path": "<file_path>"
},
"name": "treesitter_get_call_graph"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| output_file | No |