Skip to main content
Glama

repo_neighbours

Idempotent

Traverse code graph relationships from a known node_id to inspect callers, callees, base classes, and definitions. Use for read-only graph expansion, not text search or repo overview.

Instructions

Traverse code graph relationships from a known symbol or file node_id (callers, callees, base classes, definitions). Read-only, deterministic traversal, no side effects. When to use: use with a specific node_id (e.g. from repo_search citations) to inspect callers (CALLS in), callees (CALLS out), inheritance, or definitions. When NOT to use: do not use for text search across code (use repo_search) or repo overview (use repo_map). Output: markdown list formatted as - <EDGE_TYPE> <in|out>: <name> (<path:line>) [<node_id>].

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hopsNoTraversal depth from node_id (default 1, max 4).
limitNoMaximum neighbor rows to return (default 20, min 1, max 50).
node_idYesTarget graph node identifier to expand from (e.g. 'sym:pkg/mod.py::func', 'file:pkg/mod.py', 'dir:pkg').

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.0.0
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum neighbor rows to return (default 20, max 50)."New value: +"Maximum neighbor rows to return (default 20, min 1, max 50)."
  2. Changed3 schema fields changedv1.5.1
    • changedInput schema / properties / hops / description
      Previous value: -"graph hops (default 1, max 4)"New value: +"Traversal depth from node_id (default 1, max 4)."
    • changedInput schema / properties / limit / description
      Previous value: -"neighbours (default 20, max 50)"New value: +"Maximum neighbor rows to return (default 20, max 50)."
    • changedInput schema / properties / node_id / description
      Previous value: -"e.g. sym:pkg/a.py::run"New value: +"Target graph node identifier to expand from (e.g. 'sym:pkg/mod.py::func', 'file:pkg/mod.py', 'dir:pkg')."
  3. First observedv0.1.0

TDQS

A3.8/5.0
Behavior1/5

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

The description asserts 'Read-only, deterministic traversal, no side effects', but the annotations declare readOnlyHint=false. This is a direct conflict on the tool's mutation profile, so the description cannot be trusted as behavioral disclosure. It also fails to reconcile the openWorldHint=true annotation with the claim of a fully deterministic, side-effect-free traversal.

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?

Purpose and behavior are front-loaded, and the labeled When to use / When NOT to use / Output sections are easy to scan with no filler. Slightly over-specified for its length, and one sentence carries the erroneous read-only claim, but overall it is tight and well ordered.

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?

With no output schema, the description compensates by specifying the return format ('- <EDGE_TYPE> <in|out>: <name> (<path:line>) [<node_id>]') and the edge direction convention (CALLS in vs CALLS out). Combined with the routing guidance and parameter coverage, an agent has everything needed to call and interpret this 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 description coverage is 100%: hops, limit, and node_id each carry their own defaults, bounds, and format examples in the schema. The description only adds the provenance hint for node_id (comes from repo_search citations) and does not clarify hops/limit interaction with the traversal, so 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 names a specific verb (traverse) and resource (code graph relationships from a node_id) and enumerates the edge kinds covered (callers, callees, base classes, definitions). It is immediately distinguishable from repo_search (text search) and repo_map (overview), which are named explicitly.

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?

It gives explicit 'When to use' and 'When NOT to use' sections, names the concrete trigger (a node_id obtained from repo_search citations), and routes the agent to the correct alternatives (repo_search for text search, repo_map for overview). Nothing about tool selection is left to inference.

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