Skip to main content

MCP Tools Reference

Travsr exposes tools over the Model Context Protocol. All tools use JSON-RPC 2.0. The original graph query tools work over both stdio and SSE transports; the repo and synonym management tools are stdio-only.

Graph query tools

ToolWhat it returns
get_dependenciesDirect and transitive imports for a file
get_callersAll call sites of a symbol across repos
get_blast_radiusFiles that would break if this file changes
search_symbolSymbol definition locations by name
get_repo_mapStructural overview of a repository
get_execution_pathPCST path between two symbols
get_contextFull PPR + knapsack context for a query (synonym-aware)
get_graph_statsExact node/edge counts + last-indexed commit
get_graph_jsonRaw subgraph as node/edge JSON for renderers
get_snippetsKind-aware source snippets for named symbols
get_lang_statusWhether semantic (Phase B) analysis is active for a file's language

Repo management tools (stdio-only)

ToolWhat it does
repo_languagesPer-language node counts for the indexed repo
repos_listAll repos in the Travsr registry with DB existence status
repos_pruneRemove registry entries whose DB file no longer exists
repos_removeRemove one registry entry by name

Synonym tools (stdio-only)

ToolWhat it does
synonym_listList all synonym pairs
synonym_addAdd an alias to a term
synonym_setReplace all aliases for a term
synonym_removeRemove one alias or an entire term
synonym_resetRestore built-in synonym defaults

JSON Schema conventions

All tools accept a single JSON object. Required fields are marked "required": [...]. Paths are relative to the repository root unless a repo parameter is specified. Use dot notation for symbols (ClassName.methodName) or #-qualified signatures (src/auth/jwt.ts#sign).

Error format

{
"error": {
"code": "SYMBOL_NOT_FOUND",
"message": "No symbol matching 'PaymentService.charge' in repo.",
"details": { "repo": "/Users/me/my-project" }
}
}

Error codes

CodeMeaning
SYMBOL_NOT_FOUNDNo node matching the given name or path
FILE_NOT_FOUNDThe given file path does not exist in the graph
GRAPH_STALEThe graph is behind HEAD; run travsr init (or commit to trigger the hook)
BUDGET_EXCEEDEDToken budget too small to return any meaningful result
REPO_NOT_INDEXEDThe repo has not been initialized with travsr init