Skip to main content
Glama

Get Context

synapse_get_context

Retrieve 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

TableJSON Schema
NameRequiredDescriptionDefault
kindNoFilter results by entity kind (used in action 'find').
lineNoLine number within file_path (used in action 'edit').
pathNoFilter results by partial path (used in action 'find').
depthNoCallee traversal depth (used in action 'onboard', default 3).
limitNoMaximum number of results to return.
queryNoNatural language query or symbol name. Required for 'onboard' (entry point for the reading guide); used in 'find' for semantic/symbol search.
actionYesContext action to perform.
formatNoInclude structured result metadata and relevance provenance for action 'find'.markdown
intentNoDescribe what you plan to change (used in action 'edit').edit behaviour safely
symbolNoTarget symbol name (alternative to chunk_id for action 'edit').
repo_idNoRepository 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_idNoTarget chunk identifier (used in action 'edit' and 'explain').
languageNoFilter results by language (used in action 'find').
file_pathNoTarget file path (alternative to chunk_id for action 'edit').
max_tokensNoApproximate final response budget in tokens (500-32000, default 4000).
risk_levelNoThe risk level of your change (used in action 'edit').medium
exclude_testsNoExclude test files from results (used in action 'find').
compress_payloadNoSet false to disable lossless response-key compression.
wait_for_ready_msNoOptional timeout in ms to wait for the indexer to finish warming up and enter an idle state before executing. Use to ensure stable results.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the burden of behavioral disclosure. It does well: it explains the at-most-5 high-confidence match cap without repo_id, mentions meta.unscoped_retrieval, details what each action gathers or produces, and discloses token compression behavior. A small gap is that it never explicitly states that this is a read-only operation and never mutates code, though calling it 'retrieves' strongly implies it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with high-level purpose and actions, but it repeats key points: 'Pass the exact repo_id...' appears multiple times, and 'action edit' is emphasized twice. The 'Usage (short)' vs 'Usage (long)' sections also add redundancy. Overall, it is longer than necessary, but the information is organized and relevant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of this tool (19 parameters, no output schema, no annotations), the description is largely complete: it covers all four actions, tells the agent how to obtain a repo_id, explains behavior without repo_id, and describes what the edit action should gather. It does not fully describe the overall return value structure, but the action-level descriptions and the schema help bridge most of that gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has full 100% description coverage, so the baseline is 3. The description adds meaningful semantics beyond the schema: it explains why action 'edit' is the essential pre-edit step, clarifies the impact of omitted repo_id, and breaks down what each high-level action does (e.g., find's multi-mode search, explain's layered explanation, and onboard's reading order). This is extra practical guidance, not just schema repetition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool's purpose: retrieving codebase context for understanding, editing, explaining, and onboarding. It names specific actions ('find', 'edit', 'explain', 'onboard') and directly distinguishes itself from alternatives like 'multi-file grep_search chains, sequential view_file reads' and manual code comprehension.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit guidance on when to use this tool, when not to, and how to handle edge cases. It says to pass the exact repo_id, to call synapse_manage_repos with action 'list' when repo_id is unknown, and that action 'edit' is required before modifying code. It also includes 'Instead of these alternatives' guidance, which helps an agent route to the right tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/myelixlabs/synapse-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server