Skip to main content
Glama

OCRRouter

OCR a PDF or image

ocr
Read-only

Read a PDF or image and return its text as Markdown (tables kept as tables) or JSON blocks. Pass file_url for a public link, or file_base64 for file contents. Models jina/jina-ocr and deepseek/deepseek-ocr are free; auto picks the best model for the document.

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": "ocr"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNoModel ID from list_models, or auto (default).
pagesNoPage range such as 1-5,8. Default all pages.
formatNoOutput format. Default markdown.
file_urlNoPublic http(s) URL of a PDF, PNG, JPG, WebP or GIF.
filenameNoFile name with extension, recommended with file_base64.
file_base64NoBase64 file contents, instead of file_url.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds genuinely useful behavior: which models are free, that auto selects a model per document, and that file_url must be public. It says nothing about size limits, file-size ceilings, or failure modes for private/inaccessible URLs, which matters given openWorldHint.

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?

Three short sentences, zero filler, output shape stated first and input modes immediately after. Every sentence carries information an agent needs.

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?

With zero required parameters, the description correctly signals that one of file_url or file_base64 must be supplied, and it describes return formats well enough that a missing output schema isn't a problem. It could be more complete about limits and what happens when neither source is provided.

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 adds real meaning on top: the file_url vs file_base64 tradeoff, the cost implication of specific models, and that auto resolves to the best model for the document. It does not add anything for pages or format beyond the schema's own defaults.

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 ('Read') and resource ('a PDF or image') plus the exact return shape ('text as Markdown (tables kept as tables) or JSON blocks'). Nothing about it overlaps with the only sibling, list_models, so an agent can select it without opening the 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 routing between the two input modes ('Pass file_url for a public link, or file_base64 for file contents') and explains what 'auto' does. It stops short of explicit when-not-to-use conditions, such as using list_models first to pick a non-default model.

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