Skip to main content
Glama

graph_neighbourhood

Read-onlyIdempotent

Map ownership and control edges around an entity in both directions: who it controls and who controls it. Use it for a wider view than upward-only ownership chains.

Instructions

Return every ownership/control edge within a bounded number of hops of one entity, in BOTH directions: who it controls, who controls it, and their neighbours. Use it to answer 'what sits around this company?' — the wider view that trace_ownership_path (upward only) does not give. Hard-capped in the database: depth 3, 300 edges, and at most 25 edges followed per entity per direction per hop. READ THE DEPTH FIELDS IN THE RESPONSE — DO NOT ASSUME YOU GOT THE DEPTH YOU ASKED FOR. There is no field called depth any more, and that rename is deliberate: the old depth was the CLAMPED REQUEST, never the depth walked, and it was being read as a promise. The response now carries depth_requested (what your plan allowed), depth_walked (measured off the returned edges' own hop numbers — the only depth that is actually proven), depth_capped, and completeness. Measured 2026-08-11 on an anonymous caller: depth=3 requested returned depth=2 with depth_capped=true, because the free plan caps every walk at 2 hops. Any sentence you write about what is or is not around this entity must be scoped to the RETURNED depth. EDGE COUNTS FELL BY UP TO 2.7x ON 2026-08-11 AND NOTHING WAS LOST — read this before you treat it as the corpus shrinking. Until that date the walk emitted the same edge two and three times at depth 2 or more, edge_count counted the duplicated list, and the duplicates were charged against your edges budget. Measured on identical requests before and after the fix: 72 -> 27, 29 -> 13, and at the maximum budget 300 rows holding 285 real edges -> 300 rows holding 300. So a call you made yesterday and repeat today can return far fewer edges for the same subject: the smaller number is the true one, and your budget now buys real edges. One consequence worth knowing: at depth 1 a root can drop from 4 edges to 2, because the registry genuinely holds rows that are identical in every field this endpoint returns and the response has no way to represent the difference. That is also a correction, not a loss. truncated: true plus a plain-language truncation_note does work and does mean the edge budget ran out (verified with edges=10); that is NORMAL for hub entities (the corpus holds single nodes with more than 22,000 edges) and means the picture is partial, not wrong. Each edge carries origin: 'registry' (observed in a source registry) or 'derived'/'curated'/'asserted' (inferred by Mr.Faun). Get the root id from search_entities or resolve.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "root": "<root>"
    },
    "name": "graph_neighbourhood"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootYesRoot entity uuid.
depthNoHops to walk (default 2). A REQUEST, not a guarantee — the plan caps it (anonymous callers measured at 2 hops) and the response's `depth_walked` is the authority — it is measured from the edges that came back, not echoed from your request.
edgesNoEdge budget (default 120). Lower it for a legible picture, raise it for completeness.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.11

TDQS

A4.3/5.0
Behavior5/5

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

Far beyond the annotations: it discloses the hard DB caps (depth 3, 300 edges, 25 edges followed per entity per direction per hop), that free plans clamp depth to 2, that `truncated: true` is normal for hub entities with >22,000 edges, and what `origin` values mean. It also warns explicitly not to trust the requested depth and points at the authoritative measured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is strongly front-loaded — the first two sentences are the most useful in the definition — but then expands into a long changelog about the 2026-08-11 deduplication fix, with repeated 'that is a correction, not a loss' framing and three before/after measurements. That history is useful once, not three times, and it crowds out selection-relevant content.

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?

For a read-only graph traversal with no output schema, everything an agent needs is present: caps, plan-dependent clamping, the field names carrying measured depth, truncation semantics, and edge provenance. The caller is told how to scope any claim about the result, which is the main correctness risk for 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% and the schema already documents `root`, `depth` as a request with plan capping, and `edges` as a budget, so the baseline applies. The description adds one real datum not in the schema (anonymous callers measured at a 2-hop cap) but spends most of its length on response-field and changelog material rather than parameter meaning.

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 opening sentence gives a specific verb and resource ('Return every ownership/control edge within a bounded number of hops of one entity'), states the scope ('in BOTH directions: who it controls, who controls it'), and explicitly contrasts with the sibling trace_ownership_path ('upward only'). An agent can distinguish it from trace_ownership_path and graph_path without opening any schema.

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 a clear use case ('what sits around this company?') and names the alternative it supersedes for the wider view, plus it tells the caller where to obtain the root id (search_entities or resolve). It stops short of an explicit when-not-to-use rule, e.g. no guidance on cost trade-offs versus graph_path or when a single-hub answer is preferable to a neighbourhood walk.

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