Skip to main content
Glama

Read a document

read_document

Read a PDF or an image (JPEG, PNG, WebP) and return its text, its key fields (vendor, dates, totals, VAT, ids…) and its tables, page by page. Built for Hebrew and English documents, including mixed right-to-left lines. Costs one page from the key's account per page read; a page that fails is not charged. Up to 20 pages per call: read longer PDFs in ranges with "pages". A call of many pages can take more than a minute. Pages your client stops waiting for may still be charged, so if a call times out, read smaller ranges, for example 5 pages per call.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "read_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
hintNoWhat the document is, if known. Default: auto.
pagesNoPDF pages to read, for example "1-5,8". Default: from page 1, up to the per-call limit.
file_urlNoA public https URL of the document. Use this or file_base64.
languageNoLanguage of the field labels and summary in the result. Default: en.
file_base64NoThe document's bytes, base64-encoded. Use this or file_url.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / hint / enum
      Previous value: -[
      -  "auto",
      -  "invoice",
      -  "receipt",
      -  "card",
      -  "table",
      -  "text"
      -]New value: +[
      +  "auto",
      +  "invoice",
      +  "receipt",
      +  "card",
      +  "table",
      +  "text",
      +  "payslip",
      +  "pension"
      +]
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the billing model (one page per page read, failed pages uncharged), the worst-case cost behavior (abandoned pages may still be charged), and latency (over a minute for multi-page calls). These are exactly the non-obvious traits an agent needs before invoking a metered call.

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?

Capability is front-loaded, then cost, then limits, then the timeout workaround — every sentence carries actionable information and none repeats the schema or title.

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 metered extraction tool with no output schema, the description supplies formats, return shape, cost model, page limits, and latency/timeout behavior — everything needed to call it correctly and avoid surprise charges.

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 baseline is 3, but the description adds real constraint semantics: the 20-page per-call cap that governs 'pages', the range syntax usage, and that page selection applies to PDFs. The 'hint' enum values (invoice, receipt, table, etc.) are not explained in prose, leaving a small gap.

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 PDF/image) plus exactly what comes back — text, key fields (vendor, dates, totals, VAT, ids) and tables, page by page — with supported formats and languages enumerated. An agent can separate this from buy_pages/check_balance without looking at 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete operating guidance: use 'pages' ranges for PDFs over 20 pages, and reduce to ~5 pages per call on timeout. It does not explicitly name the sibling tools or say when to call buy_pages/check_balance instead, so routing between siblings is left implicit.

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