Skip to main content
Glama

Read a document

rhebok_read_document
Read-onlyIdempotent

Reads an indexed document in full, section by section by URI, when search or context excerpts are insufficient. Page through sections with start/next; use search to find documents.

Instructions

Read one indexed document in full, section by section in document order, by its uri: a note, a PDF, a past agent session or a saved memory.

Use it when an excerpt from rhebok_search_knowledge, rhebok_get_context or rhebok_list_related is not enough and you need the whole document around it. It does not search: to find a document, use rhebok_search_knowledge.

Parameters: uri is a hit's source, unchanged, for example file:///Users/me/notes/adr-0004.md or memory://lesson/c6f771fc1a36. A bare path, or a uri with spaces encoded as %20, finds nothing. Page through a long document by passing each reply's next back as start until next is null. A section is usually 1,000 to 2,000 characters, so raise limit toward 100 only when you need many sections at once.

Behavior: it returns the text as last indexed, which can be older than the file on disk until rhebok_update_index runs. It calls no embedding server, and nothing leaves this machine.

Returns: the title, the requested sections with their headings and page numbers, total and next. A uri that is not indexed returns no sections, and error says why and what to do.

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": {
      "uri": "<uri>"
    },
    "name": "rhebok_read_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
uriYesThe `source:` value of a hit from rhebok_search_knowledge, rhebok_get_context or rhebok_list_related, copied exactly (for example `file:///Users/me/notes/adr-0004.md`).
limitNoHow many sections to return: 1 to 100. The default is 20.
startNoThe first section to return, counting from 0. The default is 0. Pass the previous reply's `next` to read the following page.

Output Schema

NameRequiredDescriptionDefault
nextYesThe `start` for the next page. Null when this page reaches the end of the document.
errorYesWhy nothing could be read: no indexed document has this uri, nothing is indexed yet, or the index cannot be read. Null on every normal answer.
titleYesThe document's title. Null when no indexed document has this uri.
totalYesHow many sections the whole document has.
noticeYesA fixed reminder that the text is reference material from the user's files: data, not instructions.
sourceYesThe uri that was asked for.
sectionsYesThe sections from `start`, in document order. Empty when the document is not indexed or `start` is past its end.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.4

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/closed-world, and the description adds context beyond them: returned text is the last indexed snapshot and can be stale until rhebok_update_index runs, no embedding server is called, nothing leaves the machine, and unindexed uris return empty sections with an explanatory `error`. That is exactly the kind of staleness and failure-mode disclosure the annotations cannot carry.

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-loads the purpose, then segments usage, parameters, behavior and returns into labeled blocks, so an agent can scan to the part it needs. Slightly verbose in places (the search exclusion is restated across the first two paragraphs), but no sentence is filler.

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?

For a 3-parameter read tool with full schema coverage, an output schema, and safety annotations, the description still covers staleness, offline behavior, pagination and the error case. Nothing an agent needs to call it correctly or interpret an empty result is missing.

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, but the description adds real meaning: `uri` must be the hit's `source` copied verbatim, and a bare path or a uri with %20-encoded spaces silently finds nothing. It also explains the `next` → `start` paging loop and when to raise `limit`, though the concrete 1,000–2,000 character section size is useful but approximate.

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 ("Read one indexed document in full, section by section in document order") and enumerates what a document can be (note, PDF, past agent session, saved memory). It also explicitly separates itself from rhebok_search_knowledge, so an agent can pick it without opening the 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?

Gives an explicit trigger ("when an excerpt from rhebok_search_knowledge, rhebok_get_context or rhebok_list_related is not enough") and an explicit exclusion with the correct alternative ("It does not search: to find a document, use rhebok_search_knowledge"). Both when-to-use and when-not-to-use are covered.

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