Skip to main content
Glama

expand

Read-onlyIdempotent

Retrieve typed-edge neighborhoods around seed documents via BFS, returning citation packets with hop, edge type, and direction provenance, filterable by edge type and properties.

Instructions

Typed-edge BFS retrieval. Returns the typed-edge neighborhood of one or more seed documents as a flat array of citation packets, each carrying via: {seed_doc_id, hop, edge_type, direction} provenance. Hops hard-capped at 2 (v2.0.0). Default direction = 'both'. Filterable by edge_type and by document properties (strict equality, no operators). Memory-sink documents (_memory/...) surface only when they are already linked from a user note in the result set (per ADR-004 memory-namespace opacity rule). Frontmatter-ref edges are extracted heuristically: [[...]] syntax in any property value OR allowlisted property names (assignee, owner, project, related, parent, child, attendees, superseded_by) matched against note_aliases. include_superseded defaults to false (Phase 2 D-03 forward-only supersede). Unknown seed_doc_ids do not throw — they are returned in a warnings: [{seed_doc_id, reason: 'unknown_doc'}] array. Shortest path wins on dedup; ties broken by (seed_doc_id, edge_type, direction).

Input Schema

NameRequiredDescriptionDefault
hopsYesHop cap (1 or 2). v2.0.0 hard-caps at 2.
relsNoDomain role filter; omitted = all, empty = no edges.
directionNoEdge traversal direction; default 'both'.both
edge_typesNoOptional filter on edge types; default = all four types.
seed_doc_idsYes1+ opaque DocIds (e.g. obsidian-fs://<vault>/<path>) — seeds of the BFS.
filter_propertiesNoStrict-equality predicate on document properties (e.g. {type: 'Project'}).
include_supersededNoWhen false (default), docs whose properties.status === 'superseded' are dropped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.5.0
    • changedInput schema / properties / direction / enum
      Previous value: -[
      -  "forward",
      -  "backward",
      -  "both"
      -]New value: +[
      +  "forward",
      +  "backward",
      +  "both",
      +  "outgoing",
      +  "incoming"
      +]
    • addedInput schema / properties / rels
      Added value: +{
      +  "description": "Domain role filter; omitted = all, empty = no edges.",
      +  "items": {
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. First observedv2.0.0-rc.5

TDQS

A4.2/5.0
Behavior5/5

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

Annotations cover safety (readOnly/idempotent/non-destructive), and the description goes well beyond: hard hop cap, default direction, dedup rule with tie-breaking, the memory-namespace opacity rule (ADR-004), supersede default behavior, and the non-throwing unknown-seed warning contract. This is rich, non-obvious behavioral disclosure.

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?

Front-loaded with purpose, but the description is a dense wall of clauses and parenthetical rule IDs (ADR-004, Phase 2 D-03) that padding readability. Most sentences earn their place, but the packing is heavy for a single paragraph.

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?

Very complete for a complex graph-expansion tool with nested filter_properties and 7 params: hop cap, direction, dedup, supersede, warnings, and namespace rules are all covered. Lacking an output schema, the description still describes the packet shape, so only minor gaps remain.

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 meaning beyond the schema: it clarifies filter semantics ('strict equality, no operators'), explains when memory-sink docs are surfaced, and documents the default-false supersede rule and the unknown-seed warning handling.

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 the specific retrieval algorithm (typed-edge BFS) and the exact resource (typed-edge neighborhood of seed documents), and describes the return shape (flat array of citation packets with via provenance). An agent can immediately distinguish this from siblings like list_backlinks, list_forward_links, or recall.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implicitly this is the graph-expansion tool vs the search_* tools, but the description never names an alternative or states when to prefer expand over list_backlinks/list_forward_links/fetch. Usage is inferable from the algorithm name but not explicitly guided.

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