Skip to main content
Glama

neighbors

Expand a seed entity's graph neighborhood up to six hops, returning connected entities and relations with per-hop direction tags; filter by predicate and cap results.

Instructions

Expand an entity's neighborhood up to 6 hops and return the hydrated neighbor entities plus the relations connecting them, each hop tagged direction=outgoing|incoming relative to the seed. LLM-free graph walk: pass a recall anchor as the seed and traverse the structure yourself. The DEFAULT view is point-in-time NOW: only edges valid now and not superseded; pass includeInactive=true for full history, or time-travel with at/asOf. Filter edges by predicate. The limit (default 50) caps total neighbors across all hops, so deep walks stay bounded.

Input Schema

NameRequiredDescriptionDefault
atNoValid-time anchor (RFC 3339 UTC). Walk edges live at this instant. Defaults to now.
asOfNoTransaction-time anchor (RFC 3339 UTC). Ignore edges recorded after this instant.
seedYesEntity to expand from: an entities/{uid} ref (as returned in a recall hit's entities[]), a bare uid, or a display name (resolved case-insensitively; an unknown or ambiguous name returns an error naming the candidate uids so you can retry).
depthNoHops to expand. 1 = direct neighbors, 2 = neighbors-of-neighbors, up to 6. Defaults to 1.
limitNoMaximum neighbors to return across all hops. Defaults to 50.
scopesNoScopes to read from: project, personal, team. Defaults to project+personal. Unknown values are rejected.
predicatesNoOnly follow edges with these predicates. Omit to follow any.
includeInactiveNoFollow superseded / expired edges too. Off by default.

Output Schema

NameRequiredDescriptionDefault
neighborsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full load, and it does disclose the key behavioral trait: the default view is point-in-time NOW with only currently-valid, non-superseded edges, plus the fact that limit caps neighbors across all hops. It says nothing about permissions, scope enforcement behavior, cost of deep walks, or what happens when the walk is truncated by limit — meaningful gaps for a traversal tool.

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?

Front-loads the core action and return shape, then layers defaults, time modes and the limit cap. Dense but nearly every clause carries information; the 'LLM-free graph walk' framing is the only clause that is more rhetorical than operational.

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?

Covers the essentials for an 8-parameter traversal tool: seed forms, depth, the three time modes, predicate filtering, scope defaults and the cross-hop limit cap. Since an output schema exists, it need not describe the return payload, and its remaining omission (pagination/truncation behavior and permission requirements) is minor but real.

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% and each parameter is thoroughly documented in the schema (seed ref formats, depth 1–6, limit, scopes, at/asOf semantics). The description restates depth, limit default, includeInactive, predicate filtering and time anchors, adding emphasis but little meaning beyond what the schema already provides, so 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?

States a specific verb and resource — 'Expand an entity's neighborhood up to 6 hops' — and names exactly what comes back (hydrated neighbors plus connecting relations, hop-tagged direction). It is clearly not a generic query, but it never contrasts itself with plausible siblings like relations, getEntityContext, or recall, leaving disambiguation to inference.

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?

Gives a concrete usage pattern ('pass a recall anchor as the seed and traverse the structure yourself') and explicit mode selection guidance: default NOW view, includeInactive=true for full history, or at/asOf for time travel. No statement of when NOT to use it versus sibling graph tools, so it stops short of a 5.

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