Skip to main content
Glama

ocr

Convert PDFs or images into page-by-page Markdown from URLs, data URLs, or local file paths, optionally extracting figures to an output directory. Select specific pages or ranges to control cost.

Instructions

MinerU2.5-Pro 文档 OCR:PDF/图片 → 逐页 Markdown。document 为 http(s) URL、 data URL 或本地文件路径(托管模式请用 URL)。pages 为页码列表 [0,1,2] 或范围 "0-5"。 include_images=true 时提取插图并落盘到输出目录(返回路径,不内联 base64)。 按页计费(pts);长文档整篇解析完才返回,耗时较长。

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

Input Schema

NameRequiredDescriptionDefault
pagesNo
documentYes
image_limitNo
include_imagesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and it does disclose unusual traits beyond structured fields: per-page billing in points, that long documents return only after the entire parse completes (slow, blocking), and that include_images writes files to disk and returns paths instead of inline base64. It omits auth/permission requirements and what the response looks like beyond the Markdown pages.

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?

The text is front-loaded with name and purpose, then moves through input format, pagination, image handling, and cost/latency, with one sentence per concern. Every sentence adds information an agent needs, with no filler.

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 four-parameter conversion tool with no output schema and no annotations, this definition covers input forms, page selection, side effects of image extraction, billing, and latency, which is enough for an agent to decide when to call this tool and how to call it correctly. Only image_limit and the exact response envelope are unaddressed, which is minor.

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 description coverage is 0%, so the description must compensate; it documents document (three accepted input forms, plus the hosted-mode restriction), pages (list and range syntax), and include_images (side effects and return shape). The fourth parameter, image_limit, is never mentioned, and its interaction with include_images is left unclear.

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?

The definition names a specific verb and resource (document OCR) and states the transformation (PDF/image → per-page Markdown) together with the underlying model (MinerU2.5-Pro). It is clearly distinguishable from every sibling tool (chat, speech, instance_*), none of which perform document conversion.

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?

It gives concrete usage context: in hosted mode you must pass a URL rather than a local path, and pages can be a list or a range. It does not name any when-not conditions or alternatives, but the sibling list contains no comparable OCR tool, so there is little routing ambiguity to resolve.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.