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?"}
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) |