Skip to main content
Glama

Codebase structural query — Atom

Codebase structural query

codebase_structural_query
Read-onlyIdempotent

Submit a code-graph index (nodes and typed edges) plus one structural query; get a deterministic graph answer — descendants, ancestors, blast radius, shortest typed path, stats, or snapshot — aggregate-first (counts and kind breakdowns; full node lists only on expand). Never answers from an index declared stale.

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": "codebase_structural_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
graphNoThe code-graph index: {nodes: [{id, kind}], edges: [{from, to, kind}]}.
indexNoIndex metadata: {stale: bool} — a stale index is never answered from.
queryNoThe query: {intent: descendants|ancestors|blast_radius|path|stats|snapshot, target, target_b, expand}.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, so safety is covered; the description adds genuinely new behavior: deterministic answers, aggregate-first result shaping controlled by expand, and a hard refusal to answer from an index declared stale. It does not describe error behavior or size limits, keeping it below 5.

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

Conciseness4/5

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

A single dense sentence, front-loaded with the submit/get contract and then the result modes; every clause carries information. The em-dash chains and parenthetical make it slightly hard to scan, but nothing is padding.

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

Completeness4/5

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

For a three-parameter tool with nested objects, full schema coverage, and annotations, the description covers input shape, the aggregate-vs-expand result behavior, and the stale-index guard. With no output schema it sketches the return shape adequately, though it never details the node/edge schema itself, deferring to an off-tool SERVICE.md reference.

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%, so the baseline is 3. The description does add value by enumerating the intent values and explaining that expand toggles between counts/kind breakdowns and full node lists, but it adds nothing about target, target_b, or the edge typing beyond what the schema already declares.

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+resource pair (submit a code-graph index plus one structural query) and names the exact answer classes it returns: descendants, ancestors, blast radius, shortest typed path, stats, snapshot. An agent knows precisely what goes in and what kind of result comes out; no sibling tools exist to confuse it with.

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

Usage Guidelines4/5

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

Implies the precondition clearly (you must already hold a code-graph index) and gives an actionable default posture: aggregate-first, with full node lists only when expand is set. It does not explicitly state when not to use it or what to do instead, so it stops short of a full 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.