Skip to main content
← MCP Tools

get_graph_stats

Return accurate node and edge counts from the indexed graph. Use this instead of parsing get_repo_map output when you need exact counts.

Availability: single-repo stdio (travsr mcp) and global stdio (travsr mcp --global). Not served over SSE.

Input schema​

{
"type": "object",
"properties": {
"repo": {
"type": "string",
"description": "Repo name (run repos_list to discover). Sums all repos if omitted. Only present in global (multi-repo) sessions; a single-repo stdio session takes no arguments at all."
}
},
"additionalProperties": false
}

There is no last_commit field or parameter; freshness is reported by get_index_status, not by this tool.

Output format​

Plain text, returned raw (not wrapped in a <travsr-data> envelope), three lines:

nodes: <count>
edges: <count>
schema_version: <n>

The global (multi-repo) variant sums counts across every registered repo (or one named repo), omits schema_version, and prepends a note naming any repo it had to skip because its database could not be opened.

Example​

Request:

{}

Response:

nodes: 17718
edges: 33690
schema_version: 23

This is the Travsr repository indexed with v1.2.1; schema_version is the store's schema version and moves with Travsr releases, so read it rather than hardcoding it.

When to use​

  • VS Code extension / tooling: display accurate node and edge counts in status bars or dashboards. get_repo_map undercounts nodes because it only rolls up module-level summaries.
  • Health monitoring in CI: assert that a full reindex produced the expected number of nodes after a migration or schema change.
  • Freshness checks: pair with get_index_status to confirm the graph is not just non-empty but current with HEAD before running expensive retrieval queries.

Notes​

  • Counts come directly from the store's node and edge tables. They are always accurate and never estimated.
  • In a global (multi-repo) session, pass repo explicitly to get per-repo stats instead of the sum across every registered repo.