Skip to main content
Glama

Get a node's neighborhood

codetopo_neighborhood
Read-only

Explore a code graph node's neighborhood by retrieving the subgraph within a set number of hops in both directions, excluding contains/defines edges.

Instructions

The subgraph within a few hops of a node, in both directions (contains/defines excluded).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeYesNode id at the center.
depthNoHops to walk (default 1).
db_pathYesPath to the index database.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds genuine behavioral context beyond that by disclosing edge-type filtering (contains/defines excluded) and bidirectional traversal, but says nothing about result size, depth limits, or traversal cost.

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 tight sentence with no filler, and the scoping qualifier is front-loaded. The only flaw is that it reads as a sentence fragment rather than a complete clause, which slightly impairs immediate comprehension.

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

Completeness3/5

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

No output schema exists, so the description needn't explain return values, and annotations carry the safety profile. For a traversal tool with three fully documented parameters, though, it is terse: it omits any sense of graph size, result limits, or how the neighborhood relates to the ancestor/descendant tools.

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 node, depth, and db_path are already documented, including the depth default of 1. The description's 'within a few hops' and 'at the center' loosely restate the schema semantics without adding format or constraints, so the baseline 3 applies.

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

Purpose4/5

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

The description identifies the resource ('the subgraph within a few hops of a node') and its bidirectional scope, which is specific enough to separate it from single-direction traversal. However, it is a noun fragment with no verb, and it never names the siblings (descendants/ancestors) it overlaps with, so differentiation is only implied by the 'contains/defines excluded' clause.

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

Usage Guidelines2/5

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

There is no explicit when-to-use statement or named alternative. The parenthetical exclusion of contains/defines edges weakly hints that containment traversal belongs to codetopo_descendants/codetopo_ancestors, but the agent must infer that routing on its own.

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