generate_codemap
Generate a code flow map with Mermaid diagram and narrative trace to answer a query about code execution across files, including file paths and line numbers.
Instructions
Generate a Windsurf-style codemap: a focused execution-flow map with Mermaid diagram and narrative trace for a question or topic. Shows how code flows across files with file paths and line numbers. Best for understanding 'How does X work?' questions.
Requires: index_repository must be called first.
Example: {"repo_path": "/path/to/repo", "query": "How does request handling work?"}
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": {
"repo_path": "<repo_path>",
"query": "<query>"
},
"name": "generate_codemap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes | Path to the indexed repository | |
| query | Yes | Question or topic to map (e.g., 'How does authentication work?', 'Trace the request handling pipeline') | |
| entry_point | No | Optional function/class to start from (e.g., 'handle_ask_question'). Auto-discovered if not provided. | |
| focus | No | Focus mode: execution_flow (calls), data_flow (transformations), dependency_chain (imports). Default: execution_flow | |
| max_depth | No | Max call graph traversal depth (default: 5, range: 1-10) | |
| max_nodes | No | Max nodes in the codemap (default: 30, range: 5-60) |