Skip to main content
Glama

inspect_codebase_graph

Check whether a repository's AST knowledge graph exists and is healthy before building or querying it; returns read-only diagnostics on artifacts, indexed files, and build metrics.

Instructions

Inspects the operational state and artifact health of the AST knowledge graph for a repository. Safe, read-only diagnostic: reads local metadata files with zero mutations, network calls, or side effects. Discloses whether graphify-out/ exists, artifact count, indexed file statistics, and last build metrics.

When to use: Call to check whether a knowledge graph exists before deciding to build or query it. When NOT to use: Do not use to construct the graph (use build_codebase_graph) or to query specific symbol definitions and god classes (use query_codebase_graph). Returns: Graph status (ACTIVE or NOT BUILT), artifact count, indexed file count, node/edge metrics, and next action recommendations.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "inspect_codebase_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
repo_pathNoAbsolute or relative filesystem path to the target repository root. If omitted, empty string, or '.', defaults to the current working directory. Read-only access.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.1.4

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full burden and does so: it declares read-only, zero mutations, no network calls, no side effects, and states that only local metadata files are read. It also enumerates the returned fields and the two possible status values (ACTIVE / NOT BUILT), which is exactly what an agent needs absent an output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core purpose, then uses compact labeled sections (When to use / When NOT to use / Returns). Every sentence adds distinct information; nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having no output schema and no annotations, the description covers safety profile, triggering conditions, exclusions, and the shape of the return value. Nothing material is missing for a single-optional-parameter diagnostic tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the single repo_path parameter already documents default behavior and read-only access, so the schema does the heavy lifting. The description adds no additional path syntax or resolution semantics beyond what is in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Inspects the operational state and artifact health of the AST knowledge graph for a repository.' It also names the two sibling tools it is not (build_codebase_graph, query_codebase_graph), so the agent can route without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'When to use' (check whether a graph exists before building or querying) and 'When NOT to use' with named alternatives for the build and query cases. No inference required.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.