Skip to content

MCP tools

codescope registers these tools over MCP. Their descriptions are written for the agent — they nudge it to query the graph instead of grepping and reading whole files.

Fuzzy substring search over definitions (functions, classes, methods, interfaces, types, enums) across the whole repo. The agent’s replacement for grep/glob when locating where something is defined.

search_symbols(query: string, kind?: SymbolKind, limit?: number)
Terminal window
> search_symbols loadConfig
function export loadConfig — src/config.ts:12 · function loadConfig(): Config
type ConfigShape — src/config.ts:4 · type ConfigShape = { … }

Look up a definition by its exact name — kind, file:line, and signature.

get_symbol(name: string, limit?: number)

The distinct callers of a function/method (both bare foo() and x.foo()), grouped by file. “Who depends on this?“

find_callers(name: string, limit?: number)
Terminal window
> find_callers parseSource
src/indexer.ts:97 indexFile

The functions/methods a symbol calls, resolved to their definitions — the outgoing side of the call graph. “What does this depend on?“

find_callees(name: string, limit?: number)

The transitive callers of a symbol — everything that could be affected if you change it — annotated with hop distance. Run it before editing a widely-used function.

impact(name: string, depth?: number, limit?: number)
Terminal window
> impact replaceFile
[1 hop] method Indexer.indexFile — src/indexer.ts:87
[2 hop] method Indexer.indexAll — src/indexer.ts:54
[3 hop] function cmdIndex — src/cli.ts:107

Given a task or feature query, a compact ranked relevance map: the matching symbols plus their immediate call neighbourhood, ordered by how widely each is called. The fastest way to orient an agent before a change — graph facts instead of file dumps.

context(query: string, maxSymbols?: number)

Given a list of changed files, the test files likely affected — found via the symbols those files define and the import graph (so it reaches tests that import the changed module even when they never appear in the call graph). Know what to re-run without running anything.

affected(files: string[], depth?: number)
Terminal window
> affected src/store.ts
3 test file(s) affected:
test/store.test.ts
test/mcp.test.ts
test/indexer.test.ts

find_references · file_outline · neighborhood · stats

Section titled “find_references · file_outline · neighborhood · stats”
  • find_references — all references (calls + imports) to a name.
  • file_outline — every symbol in a file, in source order — a compact alternative to reading the file.
  • neighborhood — the call neighbourhood (callers + callees, a few hops) around a symbol, as a subgraph.
  • stats — counts for the indexed graph (files, symbols, refs, by kind/language).

Every tool is also available from the CLI.