Skip to main content
Glama

doc_read

Read-onlyIdempotent

Read-only queries on the open document (a file whose kind is DOC). No data is modified. Safe to auto-approve. Open the document first with files_write(open_file). Call as {"action": "", "params": {...}}.

Blocks are named by a path "." (e.g. "0.3") and carry a hash; doc_write needs the hash to change or delete a block.

Actions: • doc_outline() — Headings with their paths and hashes, plus block count, word count and block types. Start here for long documents. • read_doc(format?, from?, limit?) — Blocks in order, each {path, hash, type, content}. format: "markdown" (default) or "json" (ProseMirror JSON). Paginate with from (default 0) and limit (default 200, max 1000); next_from is null on the last page. • search_doc(query, limit?, case_sensitive?, whole_word?, regex?) — Text matches, each with the block's path and hash and a snippet. • context() — The full guide to documents: block model, Markdown support, placeholders, batches.

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": {
      "action": "<action>"
    },
    "name": "doc_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionYesAction to perform: read_doc, doc_outline, or search_doc
paramsNoParameters for the action (see tool description)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / title
      Removed value: -"DocReadAction"
  2. Added

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint/idempotentHint annotations, it explains the block-and-hash model, that blocks are addressed by '<section>.<block>' paths, pagination semantics (from default 0, limit default 200 / max 1000, next_from null on the last page), and the markdown vs ProseMirror JSON return formats. 'Safe to auto-approve' does restate the annotation, but the surrounding behavioral detail is substantial and correct.

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 safety/read-only framing, then a compact bulleted action reference — every bullet carries distinct information. Minor waste only: 'No data is modified. Safe to auto-approve.' duplicates the readOnlyHint annotation rather than adding to it.

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?

With no output schema, the description still spells out return shapes ({path, hash, type, content}, snippets with path and hash, outline with block/word counts and next_from). For a dispatcher tool whose real parameters live in a free-form 'params' object, nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema only says 'Parameters for the action (see tool description)', so the description carries the real burden and does so: it documents each action's parameters with types, defaults, and semantics (format values, from/limit, query plus case_sensitive/whole_word/regex). This is meaning well 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?

Opens with a specific verb and resource plus a defining constraint: 'Read-only queries on the open document (a file whose kind is DOC)'. The enumerated actions (doc_outline, read_doc, search_doc, context) make the scope concrete and clearly separate it from the sibling doc_write, which it explicitly names.

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?

Gives an explicit prerequisite ('Open the document first with files_write(open_file)') and per-action routing guidance ('Start here for long documents' on doc_outline, and the note that doc_write needs hashes for mutation). What it lacks is a direct contrast with files_read or a statement of when not to use doc_read, so it stops short of full alternative routing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.