Skip to main content
Glama
obsidian-pkm

obsidian-pkm

by AdrianV101

vault_read

Read markdown file contents from an Obsidian vault, with pagination by heading, line range, tail lines, or chunk to handle large notes without loading everything at once.

Instructions

Read the contents of a markdown file from the vault. Supports pagination: read a single section by heading, last N lines, last N heading-level sections, chunk number, or line range. Files exceeding ~80k characters auto-redirect to peek data (file structure/outline) unless a pagination param or force=true is specified. Every pagination mode's output is capped at ~80k characters (~400k with force), cut at a line boundary with a note naming the next 'lines' range to read. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "vault_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath relative to vault root (supports short names, e.g. 'devlog')
tailNoReturn the last N lines of the file. Frontmatter is always prepended.
chunkNoRead a specific chunk of the file (1-indexed). Each chunk is ~80k characters. Use vault_peek to see total chunks.
forceNoBypass auto-redirect for large files. WARNING: only use when full content is essential, as large files degrade model performance. Hard-capped at ~400k chars (~100k tokens).
linesNoRead a range of lines from the file (1-indexed, inclusive).
headingNoRead only the section under this heading. '## Foo' matches level and text; 'Foo' matches the text at any level (exact, case-sensitive, no prefix matching). Errors if the heading is missing or appears more than once. Returns heading line + content until next same-or-higher-level heading.
section_levelNoHeading level for tail_sections (1=`#`, 2=`##`, etc). Default: 2.
tail_sectionsNoReturn the last N sections at the specified heading level. Frontmatter is always prepended.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.0.2
    • changedInput schema / properties / heading / description
      Previous value: -"Read only the section under this heading (exact match, case-sensitive). Returns heading line + content until next same-or-higher-level heading."New value: +"Read only the section under this heading. '## Foo' matches level and text; 'Foo' matches the text at any level (exact, case-sensitive, no prefix matching). Errors if the heading is missing or appears more than once. Returns heading line + content until next same-or-higher-level heading."
  2. First observedv3.10.1

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations to lean on, the description carries the full behavioral burden and does so: it discloses the ~80k auto-redirect threshold, the ~80k/~400k output caps, line-boundary truncation with a note naming the next lines range, frontmatter handling, and the markdown-link output format. These are non-obvious traits an agent could not infer from the schema.

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 purpose and pagination inventory, then behavior, then the path-relaying caveat — a sound ordering with no filler. The ~80k cap is stated twice (redirect threshold and output cap), a minor redundancy in an otherwise dense, purposeful block.

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?

No output schema exists, and the description compensates well by describing return formatting, truncation notes, and frontmatter prepending. It is slightly incomplete on failure modes (only the heading parameter's error behavior is covered; missing-file or invalid-range behavior is unstated).

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 goes beyond it by explaining cross-parameter behavior (cap interaction, force bypass, what triggers redirect) rather than restating individual fields. It does not add per-parameter syntax the schema lacks, so it stops short of 5.

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?

Opens with a specific verb+resource ('Read the contents of a markdown file from the vault') and immediately differentiates itself from vault_peek by explaining the auto-redirect to peek data. An agent can tell exactly what this tool returns and how it differs from the outline/structure sibling.

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?

Enumerates the concrete pagination modes (single heading, last N lines, last N sections, chunk, line range) and states when force=true is appropriate versus discouraged ('only use when full content is essential, as large files degrade model performance'). It also gives explicit routing guidance for passing paths to other vault tools, which is a when/how-not instruction set rather than vague context.

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