Skip to content

Map Tools

All map tools read the pre-built index: no language-server cost, millisecond latency. Every tool accepts tokenBudget (default 2000, max 10000) and returns the standard envelope. Node IDs look like ts:src/store.ts#SessionStore.refresh — see Node IDs.

Start here on any unfamiliar codebase. Clusters of related files with their top hub symbols.

ParamTypeDefaultNotes
focusstringRestrict to a subtree, e.g. "src/auth"
hubsPerClusterint 1–205
tokenBudgetint 100–100002000

Returns {builtAt, files, symbols, staleFiles, clusters: [{id, label, files, hubs}]} where each hub carries id, kind, signature, doc, and hub score.

Fuzzy symbol lookup — the cheap way to turn a name into node IDs.

ParamTypeDefault
querystring, min 2 chars
kindfunction | class | method | interface | variable | file | anyany
limitint ≤ 10020

Exact name matches rank first, then prefix, substring, qualified-name, and file-path hits — all weighted by hub score. Name-based and possibly stale; nav_workspaceSymbols is the live equivalent.

The relationship graph around one node: callers/callees, imports, inheritance, containment.

ParamTypeDefault
nodeIdnode ID
directionin | out | bothboth
edgeKindssubset of contains imports exports calls extends implements referencesall
depthint 1–31
maxNodesint ≤ 20050

Expansion is best-first — shallow depth first, hub score within a depth — with a per-node neighbor cap of 20, so the budget keeps the valuable part. Unresolved edges appear once (flagged resolved: false, confidence: "candidate") and are not expanded.

Example:

// request
{"nodeId": "py:app/store.py#SessionStore.refresh", "direction": "in",
"edgeKinds": ["calls"], "tokenBudget": 800}
// response (envelope.data)
{
"node": {"id": "py:app/store.py#SessionStore.refresh", "kind": "method",
"file": "app/store.py", "line": 21, "score": 0.37},
"neighbors": [
{"id": "py:app/api.py#authenticate", "kind": "function",
"file": "app/api.py", "line": 15,
"edge": "calls", "direction": "in", "resolved": true,
"confidence": "name", "depth": 1}
],
"omitted": 0,
"mapBuiltAt": "2026-06-12T14:38:18Z",
"staleFiles": []
}

Shortest structural path between two symbols — bidirectional BFS over resolved imports/exports/calls/extends/implements/contains edges (the noisy references kind is opt-in via includeReferences: true). maxLen defaults to 6 hops. Returns the node sequence with each connecting edge’s kind and direction, or {found: false}.

Incremental rebuild: only changed files re-parse (content-hash diff), then cross-file edges re-resolve in full. Optional scope limits the sweep to a subtree. Never needed for nav_* correctness — those are always live. Returns {filesScanned, filesExtracted, filesDeleted, durationMs, cold}.

Health of both layers in one call: index age, file/symbol/edge counts, the stale-file list, watcher state, and per-language LSP client state (including a stderr tail for crashed servers). Cheap — call it whenever results look off.