Skip to main content
Glama

graph_neighbors

Returns structural neighbors of a graph node: called functions, callers, imports, contained items, and inherited types, up to depth hops. Use to trace code dependencies around a specific node.

Instructions

Return structural neighbors of a graph node.

Shows which functions call this node, which it calls, what it imports,
what it contains, and what it inherits from — up to *depth* hops away.

Use search_graph first to find the exact node ID.

Args:
    node_id: Node ID or label substring (e.g. "vectorstore_search" or "search").
    path: Absolute path to the codebase root directory.
    depth: Number of hops to traverse (1 = direct edges only, default 1).

Returns:
    Categorised list of neighboring nodes with their source locations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
depthNo
node_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description needs to carry the behavioral disclosure burden. It does so by stating the operation is read-only ('Return', 'Shows') and by explaining depth semantics ('1 = direct edges only'). It does not explicitly mention failure modes or prerequisites like needing an already-indexed graph, which is a minor gap.

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?

The description is concise, front-loaded with the core action, and well-organized into summary, usage hint, args, and returns. Every section adds value and there is no filler or repetition beyond negligible redundancy between 'Return structural neighbors' and 'Shows which...'.

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?

The description covers the operation, argument semantics, depth behavior, and return shape ('Categorised list of neighboring nodes with their source locations'), and an output schema exists to handle return details. A true completeness gap is the implicit requirement that the codebase graph must already be indexed, given the sibling index_graph tool; mentioning that would make it fully self-sufficient.

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

Parameters5/5

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

Schema coverage is 0%, but the description fully compensates: node_id is explained as 'Node ID or label substring' with examples, path is specified as 'Absolute path to the codebase root directory', and depth is defined as 'Number of hops to traverse' with direct-edge meaning and default. This adds substantial meaning beyond the bare 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?

The description clearly states a specific verb ('Return') and resource ('structural neighbors of a graph node'), then details exactly what kinds of relationships are included: calls, imports, containment, and inheritance. This makes it easy to distinguish from sibling tools like search_graph or search_code.

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?

It gives explicit sequential guidance: 'Use search_graph first to find the exact node ID.' This tells the agent how to prepare before calling, which is practically useful. It could go further and explicitly contrast when to use search_code or hybrid_search instead, but the neighbor-specific language makes the intended context clear.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/VecGrep/vecgrep'

If you have feedback or need assistance with the MCP directory API, please join our Discord server