get_graph_stats
Return accurate node count, edge count, schema version, and last-indexed commit for a repository's graph. Use this instead of parsing get_repo_map output when you need exact counts.
Input schema
{
"type": "object",
"properties": {
"repo": {
"type": "string",
"description": "Absolute repo path. Defaults to the daemon's primary repo."
}
}
}
Output schema
{
"type": "object",
"properties": {
"nodes": { "type": "integer", "description": "Total node count in the graph." },
"edges": { "type": "integer", "description": "Total edge count in the graph." },
"schema_version": { "type": "integer", "description": "Graph schema version stored in SQLite." },
"last_commit": { "type": "string", "description": "SHA of the last commit reflected in the graph." }
},
"required": ["nodes", "edges", "schema_version", "last_commit"]
}
Example
Request:
{}
Response:
{
"nodes": 2121,
"edges": 2136,
"schema_version": 1,
"last_commit": "20a01a3"
}
When to use
- Status checks: verify the graph is up to date with
last_commitbefore running expensive retrieval queries. - VS Code extension / tooling: display accurate node and edge counts in status bars or dashboards.
get_repo_mapundercounts nodes by ~3× because it only counts file-level symbols heuristically. - Health monitoring in CI: assert that a full reindex produced the expected number of nodes after a migration or schema change.
Notes
- Counts come directly from
SELECT COUNT(*) FROM nodesandSELECT COUNT(*) FROM edges. They are always accurate and never estimated. - In global mode (daemon watching multiple repos), pass
repoexplicitly to get per-repo stats. last_commitwill be an empty string if the repo has never been indexed.