Context Retrieval Tools
get_context
Unified context retrieval with three modes: BFS graph traversal, intent-based assembly, and call chain path finding.
Absorbs: prepare_context (via mode=“intent”), get_call_chain (via mode=“path”).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
mode | string | No | context (default): BFS graph traversal. intent: intent-based context assembly. path: call chain between two entities. |
entity | string | mode=context | Entity name (e.g. AuthService). Required for mode=context. |
depth | number | No | BFS hop limit. mode=context only. Defaults to project config value. |
token_budget | number | No | Max tokens in response. Default 4000. |
task_id | string | No | Task ID for relevance boosting. |
file | string | No | File path suffix to disambiguate entity names. |
format | string | No | Output format: compact (default) or json. mode=context only. |
detail_level | string | No | Verbosity: summary, neighbors, full (default). mode=context only. |
helpful | boolean | No | Feedback signal (true=useful, false=missed). mode=context only. |
include_inferred | boolean | No | When false, strips inferred route nodes. Default true. mode=context only. |
known_hash | string | No | Entity hash for conditional fetch. mode=context only. |
agent_id | string | No | Agent ID for peer tracking. |
intent | string | No | For mode=context: shapes traversal weights. For mode=intent: required — modify, understand, review, debug, add, plan. |
projects | string | No | Comma-separated federation aliases for cross-project context. |
cross_domain_decay | number | No | Cross-domain relevance multiplier (0,1]. Default 0.5. mode=context only. |
target | string | mode=intent | Entity name, file path, or query. Required for mode=intent. |
from | string | mode=path | Starting entity for call chain. Required for mode=path. |
to | string | mode=path | Target entity for call chain. Required for mode=path. |
Mode: context (default)
BFS/PPR ego-subgraph traversal around a named entity.
{ "tool": "get_context", "arguments": { "entity": "AuthService", "depth": 2, "token_budget": 4000 }}Mode: intent
Intent-based context assembly. Declare what you want to do and the target, get back relevant context in one round-trip.
{ "tool": "get_context", "arguments": { "mode": "intent", "intent": "modify", "target": "handleLogin" }}Mode: path
Find the shortest call chain between two entities.
{ "tool": "get_context", "arguments": { "mode": "path", "from": "handleRequest", "to": "DatabaseQuery" }}get_file_context
Returns all entities (functions, methods, structs, interfaces) defined in a file, ordered by line number. Use when working on a specific file for an instant overview.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
file | string | Yes | File path or suffix (e.g. internal/store/tasks.go or tasks.go). |
token_budget | number | No | Max response size in tokens (default 4000). When exceeded, entities are dropped from the bottom of the file. Response includes truncated=true and total_entities=N when trimmed. |
Example
{ "tool": "get_file_context", "arguments": { "file": "internal/mcp/server.go", "token_budget": 3000 }}