Skip to main content
Glama

readDocument

Read a single vault document by path or document UID to retrieve its title, body, frontmatter, tags, wikilinks, backlinks, and parsed observations for graph-based recall and provenance.

Instructions

Read one vault document by path or documentUid: its title, verbatim body, frontmatter, tags, its wikilink edges — links (what it references: mentions of entities, links_to other docs) and backlinks (what references it) — and observations (the - [category] text lines parsed from the body). Each observation is projected to a durable fact ON THIS DOCUMENT ENTITY, so query them with get(entities/{documentUid}) or maz fact get <documentUid>. A document is also an entity, so the returned document.name (entities/{uid}) pivots straight into neighbors/relations to walk the unified graph.

Input Schema

NameRequiredDescriptionDefault
pathNoVault-relative path of the document, e.g. notes/project-alpha.md. Provide this OR documentUid (exactly one).
documentUidNoStable document UID (= its entity UID). Provide this OR path (exactly one).

Output Schema

NameRequiredDescriptionDefault
linksYesOutgoing wikilink edges (what this note references): mentions → entities, links_to → other documents. Always present; [] when none.
documentYesThe document: path, title, verbatim body, frontmatter, tags, pinned. The name field is the entities/{uid} resource name for pivoting to neighbors/relations.
backlinksYesIncoming edges (what references this note). Always present; [] when none.
observationsYesStructured observations parsed from the body ('- [category] text #tag (context)' lines). EACH is projected to a durable fact on THIS document entity — query them with get(entities/{documentUid}) or 'maz fact get <documentUid>'. Always present; [] when none.
unresolvedLinksYesTarget names of [[wikilinks]] in the body that resolve to nothing in the graph (dead links). These have NO edge in 'links' precisely because they did not resolve; surface them to flag a broken reference. Always present; [] when none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/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 burden and does explain the returned sections, observation projection, and graph pivot behavior. However, it omits operational behavior such as missing-document errors, permissions, and an explicit statement that reading has no side effects.

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 main action and return contents are front-loaded in a single dense paragraph with no wasted preamble. It is somewhat complex due to the observation projection and graph-walking instructions, but those details are relevant to understanding the result.

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?

An output schema exists, so the description need not fully explain return values, but it still gives useful semantic context for the document, links, backlinks, and observations. It is nearly complete for a read operation, lacking only edge-case behavior such as missing documents.

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%, and the schema already documents the path/documentUid alternative with examples and the exactly-one constraint. The description repeats the selectors but adds no new parameter semantics beyond what the schema provides.

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 states a specific verb and resource: 'Read one vault document by path or documentUid', and lists exactly what is returned. This clearly distinguishes it from sibling tools such as listDocuments, writeDocument, and editDocument.

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?

It clearly frames usage as fetching a single document and notes that exactly one of path or documentUid should be provided. It also points to get for querying projected observations, but does not explicitly contrast with listDocuments, getBacklinks, or writeDocument.

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