Skip to main content
Glama

read_document

Read a .docx and return its HTML representation, paginated. Every edit anchor must be HTML copied verbatim from this tool or from search_document, so see the exact markup of a spot before you edit it.

WHICH TOOL FIRST — USE YOUR JUDGEMENT, DON'T DEFAULT TO READING EVERYTHING:

  • You already know WHAT text to change (a name, a date, a clause, a row, a placeholder)? Start with search_document. It returns each matching spot as a COMPLETE block — verbatim markup you can paste straight into edit_document as old — plus the page it is on, so you usually never need to read that page at all. On a long document this is far faster and cheaper than paging through it.

  • You need the SHAPE of the document (what sections exist, how a table is laid out, where a new paragraph belongs, or the request is vague like "tighten this up")? Read pages here. Start with the default span and page forward only as far as the task needs.

  • Short document, or you need all of it? One read is fine. Both tools return the SAME HTML, so an anchor from either one is equally valid.

PAGINATION: the response covers a contiguous RANGE of logical pages. By default the range starts at page 1 and returns a small span (also capped by a per-call token budget) — so a short document comes back whole. The LAST LINE of what you get back always states the range, e.g. "Pages 3-7 of 42 returned; 35 pages remain." — read it, and you always know where you are and how much you have not seen. (The same numbers travel as start_page, end_page, total_pages, total_tokens and has_more.) Pass start_page to start at a later page and end_page to widen or cap the range — a wide end_page is still bounded by the per-call token budget, so on a large document has_more stays true and you keep calling with start_page=end_page+1 until it is false. Anchors copied from any page match the whole document, so you can edit straight from a page. Don't re-read a page you have already been given, and don't page through a document hunting for a string — search for it.

Tracked changes already in the document render as (insertions) and (deletions) elements, each with a data-author. Use them to see which changes exist and who made them before you accept, reject, or modify one (see edit_document).

Comments render as around the commented text, and each comment thread appears once as an

Input Schema

NameRequiredDescriptionDefault
end_pageNo1-based last page to return; omit for a span from start_page.
start_pageNo1-based first page to return.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/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 so thoroughly: it discloses the pagination contract, the token budget cap on span size, the terminal status line format, the has_more loop, and — critically — the domain-specific rendering of tracked changes (<ins>/<del> with data-author) and comments (<mark>/<aside> with shared data-comment, data-resolved, and thread structure). This is far more than a safe-read statement; it is genuine behavioral context.

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?

Long but deliberately structured with headers (WHICH TOOL FIRST, PAGINATION) and front-loaded with the core purpose before the routing guidance. A few passages restate the same pagination facts twice (the status line and the field-name list), which is mild redundancy rather than padding.

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 read tool with two optional params and an output schema, the description covers everything an agent needs: entry conditions, span control, termination logic, anchor validity, and the markup conventions for tracked changes and comments. Nothing material is left to inference.

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 goes beyond the schema by explaining that end_page merely widens a range that is still bounded by the per-call token budget, that has_more stays true on large documents, and that the correct loop is start_page=end_page+1. That is operational semantics the schema's one-line property descriptions do not convey.

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 a .docx and return its HTML representation, paginated') and explicitly positions itself against both siblings (search_document for known targets, edit_document for applying anchors). An agent can tell instantly what this tool produces and how it differs from alternatives.

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?

The 'WHICH TOOL FIRST' block gives explicit decision rules: use search_document when you already know the text, read pages here when you need document shape or the request is vague, and a single read suffices for short documents. It also adds negative guidance ('don't re-read a page you have already been given, don't page through hunting for a string'), which is exactly the routing information an agent needs.

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.

Resources