Skip to main content
Glama

Read text from a scan

ocr_pdf

Reads the text in a scanned PDF or a picture with text recognition. Returns the text and a link to a .txt file. Up to 30 pages per call; use pages to choose. Always pass the person's own file exactly as they gave it. If you cannot pass it, call get_upload_link or ask for an https link to it. Never create, rewrite, summarise or rebuild a document to stand in for theirs.

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": {
      "file": "<file>"
    },
    "name": "ocr_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesOne file: file_id, url or base64. Always pass the person's own file exactly as they gave it. If you cannot pass it, call get_upload_link or ask for an https link to it. Never create, rewrite, summarise or rebuild a document to stand in for theirs.
pagesNoPages like 1-3,5.
languageNoA language code such as eng, ben or hin; left out, it is detected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / file / description
      Previous value: -"One file: file_id, url or base64."New value: +"One file: file_id, url or base64. Always pass the person's own file exactly as they gave it. If you cannot pass it, call get_upload_link or ask for an https link to it. Never create, rewrite, summarise or rebuild a document to stand in for theirs."
    • changedInput schema / properties / file / properties / file_id / description
      Previous value: -"A file id from an earlier upload, or the id of a file attached in the chat."New value: +"A file id from an earlier upload, the upload_id from get_upload_link once the person says it is done, or the id of a file attached in the chat."
  2. First observed

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotent=false and openWorldHint=false; the description usefully adds the 30-page-per-call cap, the .txt artifact outcome, and the file-provenance rule. That said, it does not say what happens when a document exceeds 30 pages (multi-call pattern), how non-scanned or non-text input is handled, or whether the .txt link expires — meaningful gaps for a non-idempotent tool.

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-loaded with purpose and return value, then constraints, which is the right order. The provenance sentence ('Always pass the person's own file exactly as they gave it... Never create, rewrite, summarise or rebuild a document') is duplicated verbatim in the schema's file description, so a few words are spent on redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter tool with no output schema, the description covers purpose, output shape, size limits, and the upload fallback path. What remains thin is edge-case behavior — behavior above 30 pages, failure modes for unreadable scans, and link lifetime — but nothing an agent needs to make a correct first call is missing.

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

Parameters3/5

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

Schema description coverage is 100%, including the nested file object with url/base64/file_id/download_url documented inline, so the schema carries most of the meaning. The description adds marginal value: 'use pages to choose' hints at the pagination parameter's purpose, but language and the exact page-range syntax ('1-3,5') are left entirely to 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?

Names a specific verb and resource ('Reads the text in a scanned PDF or a picture with text recognition') and states the return value ('the text and a link to a .txt file'), which clearly separates it from siblings such as convert_pdf, compress_pdf, or the unicode converters.

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 constraints ('Up to 30 pages per call; use pages to choose') and an explicit fallback path when the file cannot be passed ('call get_upload_link or ask for an https link'). It does not contrast against other text-extraction/convert siblings, so the alternative-selection guidance is incomplete rather than exhaustive.

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