Get Context
synapse_get_contextRetrieve codebase context for editing, explaining, or onboarding: locate chunks, map callers/callees, gather related tests, and assess risk in one call.
Instructions
Retrieves rich context about the codebase for understanding, editing, explaining, or onboarding. Pass the exact repo_id to keep results focused on the intended repository, especially when multiple repositories are registered; if repo_id is unknown, call synapse_manage_repos with action 'list'. High-level actions include:
'find': runs semantic search, exact symbol lookup, fuzzy matching, and call-graph traversal to locate relevant chunks. Without repo_id, it returns at most 5 high-confidence matches.
'edit': gathers callers, callees, related tests, risk assessment, and behaviour boundaries before editing a chunk.
'explain': produces a layered explanation of a chunk.
'onboard': builds a subsystem reading order and learning path.
REPLACES: multi-file grep_search chains, sequential view_file reads, manual code comprehension. Use this tool instead of these alternatives for better results with 30-60% fewer tokens via automatic compression.
Usage (short): Retrieve codebase context, explain chunks, build onboarding reading orders, or prepare pre-edit safety packs. Pass the exact repo_id to keep results focused on the intended repository. For the freshest just-edited path, use action 'edit' (analogous to current symbol lookup and graph context workflows).
Usage (long): Prepare context before edit, retrieve layered explanations, locate files/chunks for a feature, or construct reading paths. Pass the exact repo_id to keep results focused on the intended repository. If repo_id is unknown, call synapse_manage_repos with action 'list' and copy it verbatim. Without repo_id, action 'find' returns at most 5 high-confidence matches and reports meta.unscoped_retrieval. Action 'edit' is the essential pre-edit step — always call it before modifying code. It gathers callers, callees, tests, and risk in one call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Filter results by entity kind (used in action 'find'). | |
| line | No | Line number within file_path (used in action 'edit'). | |
| path | No | Filter results by partial path (used in action 'find'). | |
| depth | No | Callee traversal depth (used in action 'onboard', default 3). | |
| limit | No | Maximum number of results to return. | |
| query | No | Natural language query or symbol name. Required for 'onboard' (entry point for the reading guide); used in 'find' for semantic/symbol search. | |
| action | Yes | Context action to perform. | |
| format | No | Include structured result metadata and relevance provenance for action 'find'. | markdown |
| intent | No | Describe what you plan to change (used in action 'edit'). | edit behaviour safely |
| symbol | No | Target symbol name (alternative to chunk_id for action 'edit'). | |
| repo_id | No | Repository identifier. Pass the exact repo_id to keep results focused on the intended repository and avoid matches from unrelated registered repositories. If unknown, call synapse_manage_repos with action 'list' and copy the repo_id verbatim. When omitted for 'find', only high-confidence matches are returned, capped at 5. | |
| chunk_id | No | Target chunk identifier (used in action 'edit' and 'explain'). | |
| language | No | Filter results by language (used in action 'find'). | |
| file_path | No | Target file path (alternative to chunk_id for action 'edit'). | |
| max_tokens | No | Approximate final response budget in tokens (500-32000, default 4000). | |
| risk_level | No | The risk level of your change (used in action 'edit'). | medium |
| exclude_tests | No | Exclude test files from results (used in action 'find'). | |
| compress_payload | No | Set false to disable lossless response-key compression. | |
| wait_for_ready_ms | No | Optional timeout in ms to wait for the indexer to finish warming up and enter an idle state before executing. Use to ensure stable results. |