Skip to main content
Glama

get_document_bundle

Retrieve a document's structured bundle: citation packet, outline, backlinks, forward links, and recent edits. Supports one-hop link depth.

Instructions

Document-tree retrieval. Returns a structured bundle for a single document: { anchor (citation packet + optional status/superseded_by), outline (section tree via buildOutlineTree — same shape as get_outline.root), backlinks (citation packets + property_snippet + relation:"wikilink"), forward_links (same shape; broken links omitted), recent_edits (≤10 most recent audit_log rows mapped to {at, op, client_id, is_memory_sink_write?}) }. Every citation packet is the full 8-field D-01 shape from src/memory/citation-packet.ts. v2.0.0 accepts only depth:1 (one-hop links); the field is zod-pinned to z.literal(1) for forward compatibility. recent_edits is keyed by the anchor's CURRENT note path — pre-rename history is preserved in audit_log but not surfaced here (Phase 4 widens). Unknown doc_id returns { isError: true, error: "doc_not_found", doc_id }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYesOpaque DocId (obsidian-fs://<vault>/<path>) of the anchor document
depthNoLink-walk depth. v2.0.0: only 1 (one-hop). Phase 4 may widen.
vaultsNoOptional vault filter; usually omitted (the DocId names a vault)
Behavior5/5

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

With no annotations, the description fully discloses behavior: depth pinned to 1, broken links omitted, recent_edits limited to 10, error shape, and version constraints. This is comprehensive and transparent.

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?

The description is a single paragraph but well-structured, starting with the main purpose. It includes necessary details like version, error handling, and shape of fields. Slightly dense but earns its length.

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?

Given no output schema, the description fully specifies return shapes (anchor, outline, backlinks, forward_links, recent_edits), error handling, constraints, and versioning. It is complete for a tool of this complexity.

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 descriptions cover parameters, but the description adds context: explains the depth constraint (zod-pinned to 1 for forward compatibility) and the optional nature of vaults. This adds value beyond the schema.

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 description clearly states 'Document-tree retrieval' and details the bundled output (anchor, outline, backlinks, forward_links, recent_edits). It distinguishes from sibling tools like get_outline, list_backlinks, list_forward_links by being a composite result.

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?

Usage context is implied but not explicit. No guidance on when to use this tool vs. alternatives, nor any exclusions. The description mentions error handling for unknown doc_id but not when to prefer this over single-purpose tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/owrede/vault-memory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server