Skip to main content
Glama

Get Graph Neighbors

get_graph_neighbors
Read-onlyIdempotent

Map a note's local wikilink graph by traversing inbound and outbound links up to N hops, returning reachable notes grouped by depth for topic exploration and link analysis.

Instructions

Traverse the wikilink graph outward from a starting note and return every note reachable within N hops, grouped by depth level with an indented tree visualization. Each neighbor is tagged with its hop distance and direction (inbound = reached via backlink, outbound = reached via outlink). Use to explore a topic cluster, map a note's local neighborhood, or find related notes beyond direct links. Accepts paths with or without .md extension.

Input Schema

NameRequiredDescriptionDefault
pathYesStarting note path relative to vault root (e.g., 'projects/alpha.md'). Extension optional; falls back to basename match.
depthNoMaximum link-hops to traverse from the start note (1-3, default: 1). Higher values explore exponentially more notes.
directionNoTraversal direction: 'outbound' follows outlinks the start note points to, 'inbound' follows backlinks pointing at the start note, 'both' follows either (default)both
maxResultsNoMaximum neighbor notes to return (1-1000, default: 200). Traversal stops early when this cap is reached and a truncation notice is appended.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.1.1
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Addedv2.0.0
  3. Removedv1.9.0
  4. Addedv1.4.0
  5. Removedv1.5.3
  6. Addedv1.5.0
  7. Removedv1.5.2
  8. Addedv0.1.6
  9. Removedv0.1.4
  10. Changed3 schema fields changedv0.1.3
    • changedInput schema / properties / depth / description
      Previous value: -"Maximum number of link-hops (1-5)"New value: +"Maximum link-hops to traverse from the start note (1-5, default: 1). Higher values explore further but can return many notes."
    • changedInput schema / properties / direction / description
      Previous value: -"Direction to traverse: inbound (backlinks), outbound (outlinks), or both"New value: +"Traversal direction: 'outbound' follows outlinks the start note points to, 'inbound' follows backlinks pointing at the start note, 'both' follows either (default)"
    • changedInput schema / properties / path / description
      Previous value: -"The starting note path (relative to vault root)"New value: +"Starting note path relative to vault root (e.g., 'projects/alpha.md'). Extension optional; falls back to basename match."
  11. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/openWorld=false, so safety is covered; the description adds genuine behavioral detail beyond them — results are grouped by depth into an indented tree and each neighbor carries hop distance and direction. It does not discuss cost or the truncation behavior of maxResults (that lives only in the schema), keeping it from a 5.

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-loaded with the core traversal semantics, then return format, then use cases, then the path note — four tight sentences. The final sentence about .md extension mildly duplicates the schema, a small redundancy rather than waste.

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?

There is no output schema, so describing the returned structure (depth-grouped tree with hop tags) is exactly what's needed and it is present. Nothing essential is missing, though a word on truncation or graph-size limits would round it out.

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 depth/direction/maxResults are already fully documented. The description reinforces path extension flexibility, but that same fact is in the schema, so it adds little beyond restating structured data — baseline 3 applies.

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?

States a specific verb ('traverse the wikilink graph outward') plus the resource (notes reachable within N hops) and the return shape. It also implicitly distinguishes itself from the direct-link siblings by promising neighbors 'beyond direct links', so get_backlinks/get_outlinks are clearly not substitutes.

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?

Names three concrete use cases (explore a topic cluster, map a local neighborhood, find related notes beyond direct links), which is clear usage context. It stops short of explicit when-not guidance or naming get_backlinks/get_outlinks as the bounded alternative, so it is strong but not complete.

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