Skip to main content
Glama

Read document file

read-document-file
Read-onlyIdempotent

Read the text of a stored document file, such as a bank statement PDF, page by page.

WHEN TO USE: To read a statement's ending balance, closing date and lines before recording it with record-statement-balance. Find file documents with list-documents (they carry a file object).

RETURNS: page_count and the requested pages as text, at most 10 per call; read further with first_page.

NOTES: Reads a PDF's text layer. A statement a bank generates has one; a scanned PDF does not, and its pages come back empty, and a photo (PNG, JPEG) has none to read — ask the user for the figures then. For a text document use get-document.

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": {
      "document_id": "<document_id>"
    },
    "name": "read-document-file"
  }
}

Input Schema

NameRequiredDescriptionDefault
max_pagesNoPages to read, at most 10
first_pageNoFirst page to read (1-based)
document_idYesThe file document's id

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the description is free to add the behavior that actually causes failures: it only reads a PDF text layer, scanned PDFs return empty pages, and images (PNG/JPEG) have no text at all, with the fallback of asking the user. It also discloses the 10-page-per-call ceiling and how to continue with first_page — none of which is in the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action, then labeled WHEN TO USE / RETURNS / NOTES sections so an agent can skim to the relevant part. Every sentence carries non-redundant information (purpose, routing, limits, failure modes) with no filler or repetition of the annotation flags.

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 three-parameter read tool with no output schema, the description still discloses return shape (`page_count` plus requested `pages` as text) and the main empty-result causes. An agent has everything needed to call it correctly and to interpret an empty response rather than retrying blindly.

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 each parameter is documented in place and 3 is the baseline. The description adds the pagination workflow that the per-field schema does not convey: reads are capped at 10 pages per call and further pages are retrieved via first_page, which tells the agent how max_pages and first_page interact.

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 the text of a stored document file... page by page") and immediately scopes it to PDF-like file documents, explicitly routing text documents to get-document. An agent can distinguish it from get-document and list-documents without opening any 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?

Includes an explicit WHEN TO USE block naming the downstream purpose (reading ending balance, closing date and lines before record-statement-balance) and the discovery path via list-documents' `file` object. It also names the alternative for non-file text documents, so both the use case and the exclusion are stated.

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.