Skip to main content
Glama

query_repository_graph

Idempotent

Walk a repository snapshot's dependency graph from file or symbol seeds to identify impacted files, symbols, and change-risk scores, sizing the blast radius before running simulations or applications.

Instructions

Walk the dependency graph of one persisted repository snapshot from optional file_path/symbol_name seeds and return impacted files and symbols with change-risk scores. Seed scope comes from snapshot_id or a triage workspace_evidence_bundle_ref — one of the two is required. direction inbound follows dependents, outbound follows dependencies, both (default) walks both. Use this before simulate_repository or apply_repository to size the blast radius of a change. Read-only against the repository; persists a lookup artifact. Returns seed files/symbols, direct dependencies and dependents, impacted files/symbols, graph nodes and edges, and top_change_risk_files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directionNoEdge direction to walk: inbound = dependents, outbound = dependencies; defaults to both.
file_pathNoOptional seed file to walk the graph from.
max_depthNoTraversal depth from the seeds, 1-6; defaults to 2.
max_nodesNoGraph node cap, 1-1024; defaults to 128.
snapshot_idNoSnapshot id from create_repository_snapshot; required unless workspace_evidence_bundle_ref is given.
symbol_nameNoOptional seed symbol to walk the graph from.
repository_idYesSaved repository connector id from list_connectors.
workspace_evidence_bundle_refNoTriage bundle ref; alternative seed scope to snapshot_id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.1.3
    • addedInput schema / properties / direction / description
      Added value: +"Edge direction to walk: inbound = dependents, outbound = dependencies; defaults to both."
    • addedInput schema / properties / file_path / description
      Added value: +"Optional seed file to walk the graph from."
    • addedInput schema / properties / max_depth / description
      Added value: +"Traversal depth from the seeds, 1-6; defaults to 2."
    • addedInput schema / properties / max_nodes / description
      Added value: +"Graph node cap, 1-1024; defaults to 128."
    • addedInput schema / properties / repository_id / description
      Added value: +"Saved repository connector id from list_connectors."
    • addedInput schema / properties / snapshot_id / description
      Added value: +"Snapshot id from create_repository_snapshot; required unless workspace_evidence_bundle_ref is given."
    • addedInput schema / properties / symbol_name / description
      Added value: +"Optional seed symbol to walk the graph from."
    • addedInput schema / properties / workspace_evidence_bundle_ref / description
      Added value: +"Triage bundle ref; alternative seed scope to snapshot_id."
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true, readOnlyHint=false, and destructiveHint=false. The description adds meaningful behavioral context beyond annotations: it is 'Read-only against the repository' but 'persists a lookup artifact', which is a subtle and important side effect that annotations alone do not convey. It also discloses the traversal direction semantics and the output contents. The only minor gap is not detailing what the persisted lookup artifact is or how it is referenced later, but the description still adds substantial value beyond the annotations.

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?

The description is dense but well-structured: it front-loads the core purpose, then covers seed scope, direction, usage guidance, side effects, and return contents in a logical order. Every sentence earns its place, though the final sentence listing all return fields is somewhat long and could be trimmed without losing meaning.

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 graph-walking tool with 8 parameters, no output schema, and moderate complexity, the description covers the essential context: what it does, when to use it, the required seed scope, direction semantics, side effects, and return contents. It does not explain the persisted lookup artifact's lifecycle or how the change-risk scores are computed, but these are not necessary for an agent to invoke the tool correctly. The description is complete enough for correct selection and invocation.

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 description coverage is 100%, so the schema already documents all 8 parameters. The description adds context by explaining the relationship between snapshot_id and workspace_evidence_bundle_ref ('one of the two is required') and by defining direction semantics ('inbound follows dependents, outbound follows dependencies'). However, it does not add much beyond the schema for parameters like max_depth, max_nodes, file_path, or symbol_name, so a baseline 3 is appropriate.

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?

The description states a specific verb ('walk'), a specific resource ('dependency graph of one persisted repository snapshot'), and the key outputs ('impacted files and symbols with change-risk scores'). It also names the seed mechanism (file_path/symbol_name) and the two seed scopes (snapshot_id or workspace_evidence_bundle_ref), which clearly distinguishes it from siblings like simulate_repository or apply_repository.

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?

The description explicitly says 'Use this before simulate_repository or apply_repository to size the blast radius of a change.' This is a direct when-to-use statement with named alternatives. It also clarifies the required seed scope ('one of the two is required') and the direction semantics, so an agent knows exactly when to invoke this tool versus the sibling tools.

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

Deploy Server

Other Tools