get_repo_map
Return a structural overview of the indexed repository: components (adaptively split directories, not a fixed depth), ranked by how load-bearing they are, with a file-level preview of the top few.
Availability: single-repo stdio (travsr mcp), global stdio (travsr mcp --global), and SSE (travsr serve).
Input schema
{
"type": "object",
"properties": {
"repo": {
"type": "string",
"description": "Repo name (run repos_list to discover). Only present in global (multi-repo) sessions; always supply it there, omitting it fans out across every indexed repo and produces a very large response."
}
},
"additionalProperties": false
}
There is no depth or include_external parameter. A single-repo stdio session takes no arguments at all; components are sized adaptively (aiming for a legible number of regions per repo), not by a fixed directory depth.
Output format
Plain text, not JSON. Starts with one header line stating the ranking basis (by dependents when resolved cross-component edges exist, by symbol count otherwise), plus a note when semantic analysis has never run (dependents are then import-structure only). Below that, one line per component: <path> dependents: N symbols: M (or just symbols: M when there is no dependency data yet), ranked most load-bearing first. The top few components additionally get a file-level preview: each of their busiest files gets its own indented line naming its symbol count and up to 5 representative symbol names, with , … (+K) when there are more. If the repository is larger than fits, the response ends with +N more components (of TOTAL) rather than truncating silently.
Example
Request:
{}
Response (abridged):
Repo map, components ranked by dependents (most load-bearing first); symbols = code volume.
crates/travsr-core dependents: 5 symbols: 340
crates/travsr-core/src/lib.rs [12 symbols] Node, NodeId, VName, display_label, display_signature
crates/travsr-store dependents: 3 symbols: 512
crates/travsr-store/src/sqlite.rs [40 symbols] SqliteStore, node_count, edge_count, … (+35)
crates/travsr-retrieval dependents: 2 symbols: 780
crates/travsr-mcp dependents: 1 symbols: 940
+5 more components (of 9)
If the repo has not been indexed at all, the response is a one-line hint:
Repo not indexed by Travsr; run `travsr init` to build the graph.
When to use
- Onboarding: give a new engineer a structural map of the codebase before they start reading code.
- Architecture review: see which components other code actually depends on most, as a check against assumed layering.
- AI context seeding: call
get_repo_mapbeforeget_contextto give the agent a high-level frame before diving into details. For the full dependency graph with cycles and layering, useget_architecture_briefinstead.