You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(mcp): reconcile agent guidance + smoke to the real tool surface
The MCP surface is the deterministic structural set — the GraphRAG `ask`
tool was dropped (it remains available on the HTTP /api/chat path), and
get_callers/get_callees/get_dependencies were consolidated into a single
`get_neighbors(relation, direction)` with `get_file_neighbors` and
`find_symbol` added.
Update AGENTS.md, README.md, and the init-agent templates
(claude_mcp_section.md, cursorrules.template) to the seven registered
tools: index_repo, search_code, find_symbol, get_neighbors,
get_file_neighbors, impact_analysis, find_path. Fix scripts/mcp_smoke.py
so its expected tool set and the tools it exercises match (search_code
now takes `query`, callers come from get_neighbors direction=IN).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: api/mcp/templates/claude_mcp_section.md
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,29 +9,26 @@ need to understand how symbols connect.
9
9
| Tool | Call this when… | Example |
10
10
|---|---|---|
11
11
|`index_repo(path_or_url, branch?)`|**First** thing in a new repo; or after large changes outside your edits. Project name is **derived from the folder or repo URL** — read it back from the response. |`index_repo(path_or_url=".")`|
12
-
|`search_code(prefix, project)`| You know part of a symbol name and need its id. |`search_code(prefix="processPay", project="myrepo")`|
13
-
|`get_callers(symbol_id, project)`|"Who calls this?" — refactoring a function, tracking down a regression. |`get_callers(symbol_id=42, project="myrepo")`|
14
-
|`get_callees(symbol_id, project)`| "What does this call?" — understanding a function before editing it. |`get_callees(symbol_id=42, project="myrepo")`|
15
-
|`get_dependencies(symbol_id, project)`|All edges out of a symbol (CALLS + IMPORTS + DEFINES). |`get_dependencies(symbol_id=42, project="myrepo")`|
12
+
|`search_code(query, project)`| You know part of a symbol name and need its id (hybrid prefix + ranked match). |`search_code(query="processPay", project="myrepo")`|
13
+
|`find_symbol(name, project, file?)`|You know the exact symbol name (optionally in a given file) and want its id directly. |`find_symbol(name="processPayment", project="myrepo")`|
14
+
|`get_neighbors(symbol_id, project, relation?, direction?)`| "Who calls this?" (`direction="IN"`), "What does this call?" (`direction="OUT"`), or other edges via `relation` (CALLS/IMPORTS/DEFINES). Replaces the old get_callers/get_callees/get_dependencies. |`get_neighbors(symbol_id=42, project="myrepo", direction="IN")`|
15
+
|`get_file_neighbors(file, project)`|Symbols a file defines / depends on — "what's in this file and what does it touch?" |`get_file_neighbors(file="api/graph.py", project="myrepo")`|
16
16
|`impact_analysis(symbol_id, project, direction, depth)`|**"What breaks if I change this?"** Transitive upstream callers. |`impact_analysis(symbol_id=42, project="myrepo", direction="IN", depth=3)`|
17
17
|`find_path(source_id, dest_id, project)`| Show the call chain between two known symbols. |`find_path(source_id=10, dest_id=42, project="myrepo")`|
18
-
|`ask(question, project)`| Open-ended natural-language question. **More expensive — use last.**|`ask(question="why does login fail when MFA is on?", project="myrepo")`|
19
18
20
19
## Rules of thumb
21
20
22
-
1.**Start with `search_code`** to turn names into ids. Most tools take a `symbol_id`.
23
-
2.**Prefer structural tools over `ask`.**`get_callers` is one cheap Cypher
24
-
hop; `ask` is two LLM round-trips. Use `ask` for fuzzy/conceptual
25
-
questions, not for "who calls X".
21
+
1.**Start with `search_code` or `find_symbol`** to turn names into ids. Most tools take a `symbol_id`.
22
+
2.**Use `get_neighbors` with `direction`** for who-calls / what-calls: `IN` = callers, `OUT` = callees. Pass `relation` for IMPORTS/DEFINES edges.
26
23
3.**`impact_analysis` before refactoring.** Even when you think you know
27
24
the answer — the transitive closure often surprises you.
28
25
4.**`branch` is optional** but pass it when working on a feature branch
29
26
so you query the right per-branch index.
30
27
5.**Response shape.** Tools that return collections (`search_code`,
0 commit comments