Skip to main content
Glama

get_graph

Retrieve a graph of notes and their links, scoped by folder or root note with depth, to map vault structure and semantic connections without scanning the entire vault.

Instructions

Many notes at once and the edges between them — the heavy graph tool, and the only one that reaches for the whole vault. For one note's surroundings use get_neighbors; for who links to it, get_backlinks.

Nodes are {t} (t = title). Edges reference nodes BY POSITION in the nodes array: edges[0] = [2, 5] means nodes[2] links to nodes[5]. semantic_edges are undirected and come from embedding similarity rather than written links, with the cosine as a third number. unresolved_links are [[wikilink]] targets matching no note title — dangling, so they have no node index.

Unscoped this reaches for the ENTIRE vault and stops at max_nodes: truncated: true means you hold a recency-ordered prefix, NOT the shape of the vault. Scope with folder_id or root_title+depth rather than raising the cap.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
depthNoHop count for root_title; ignored without it
folder_idNoRestrict to notes in this folder and its descendant folders
max_nodesNoCeiling on nodes returned, most recently edited first. The reply says `truncated: true` when it applies — scope with folder_id or root_title instead of raising this
min_scoreNoCosine floor for semantic_edges — lower to see more (noisier) edges
root_titleNoKeep only nodes within `depth` wikilink-hops of this note — resolved like get_note: exact, then unique prefix, then unique substring, case-insensitive
unresolved_onlyNoIf true, return only { unresolved_links } without nodes and edges (fast check for broken links)
include_semanticNoInclude semantic_edges at all

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.3.1
    • removedInput schema / properties / folder_id / pattern
      Removed value: -"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    • addedInput schema / properties / max_nodes
      Added value: +{
      +  "default": 500,
      +  "description": "Ceiling on nodes returned, most recently edited first. The reply says `truncated: true` when it applies — scope with folder_id or root_title instead of raising this",
      +  "maximum": 5000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • changedInput schema / properties / root_title / description
      Previous value: -"Keep only nodes within `depth` wikilink-hops of this note (case-insensitive)"New value: +"Keep only nodes within `depth` wikilink-hops of this note — resolved like get_note: exact, then unique prefix, then unique substring, case-insensitive"
  2. First observedv1.3.0

TDQS

A4.9/5.0
Behavior5/5

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

No annotations exist, so the description carries the full behavioral burden, and it discloses the critical operational traits: the unscoped call hits the whole vault, hits max_nodes, and returns a recency-ordered prefix indicated by `truncated: true`, not the vault's true shape. It also describes edge positional indexing, semantic-edge direction and cosine source, and dangling unresolved links with no node index.

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?

Front-loaded with the tool's identity and its sibling alternatives, then structured paragraphs for node/edge shape, semantic edges, unresolved links, and truncation behavior. Dense but every sentence earns its place.

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?

With seven optional parameters, no annotations, and no output schema, the description compensates well: it documents the returned nodes, positional edge references, semantic edges with cosine values, unresolved_links, and the truncated flag. An agent has what it needs to scope the call and interpret the graph without surprises.

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

Parameters4/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 adds real value beyond it by explaining how root_title + depth scope the graph and by advising folder_id/root_title over raising max_nodes. It does not add much to min_score, include_semantic, or unresolved_only beyond what the schema already says.

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 and resource ('Many notes at once and the edges between them') and immediately distinguishes itself from the sibling tools get_neighbors and get_backlinks, making selection unambiguous without opening a schema.

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?

Explicitly names the alternatives and their conditions ('For one note's surroundings use get_neighbors; for who links to it, get_backlinks') and gives a scoping strategy (folder_id or root_title+depth) rather than raising the cap. When-to-use and how-to-scope guidance is complete.

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