Skip to main content
Glama

Graph neighborhood

get_graph_neighborhood
Read-onlyIdempotent

Discover which nodes and edges connect to a given graph node within a configurable depth (up to 4 hops). Use a node id or label to see the surrounding subgraph and understand what touches an action.

Instructions

Return the BFS neighborhood around one graph node by id or label: { nodes: [{ id, label, node_type }], edges: [{ source_node_id, target_node_id, edge_type }] } within a depth budget (default 2, max 4). Read-only. Tuned for "what touches this action?"; use get_knowledge_graph to traverse from a component seed, or get_graph_node for a single node's row.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedYesStarting graph node id or label to expand around (e.g. an inventory Action id or component name)
depthNoBFS hops to traverse outward. Default 2; clamped to a max of 4.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
edgesYesEdges connecting the returned nodes
nodesYesGraph nodes within the depth budget

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.10
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Addedv0.1.2

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover read-only/idempotence, and the description goes further by disclosing BFS traversal, a depth budget with default and max, and the returned node/edge structure. It doesn't over-explain beyond what an agent needs.

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?

Two compact sentences, with the core output and depth behavior front-loaded before routing guidance. Every phrase adds either operational or selection value.

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?

The definition covers what it returns, how traversal depth works, when to use it, and which siblings handle adjacent cases. With an output schema and rich annotations present, nothing material is missing.

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 reinforces that seed can be by id or label and mentions depth default/max, but those details are already present in the 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 names a specific verb and resource ('Return the BFS neighborhood around one graph node by id or label') and gives the exact return shape. It also explicitly positions itself against siblings like get_knowledge_graph and get_graph_node, so it's easy to tell apart.

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 an explicit use-case signal ('Tuned for "what touches this action?"') and names two alternatives with their distinct seeding conditions. This leaves no ambiguity about when to choose this tool.

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