Skip to main content
Glama

ocr_pdf

Convert PDF files to Markdown using OCR, with options to process specific page ranges and handle large files by splitting them into chunks.

Instructions

OCR PDF 文件并返回 Markdown(小文件直接调用;超大 PDF 建议用 start_pdf_ocr 异步执行)。

path 为本地 PDF 文件路径;pages 为页码范围(1-indexed 闭区间): "all" 全部、"5" 第 5 页、"3-10" 第 3~10 页。 大文件自动按每片 8 页切分、逐片识别后合并,临时文件用后即删。 识别期间通过 MCP 进度通知推送百分比与预计剩余时间(客户端需在调用时 附带 progressToken 才能收到)。 返回 {"status":"ok", "markdown":..., "pages":[...], "chunk_count":..., "usage":...}。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
pagesNoall
Install Server

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description must disclose behavior itself, and it does thoroughly: automatic 8-page chunking, merge behavior, temp-file cleanup, progress notifications, and the progressToken requirement are all stated. It even previews the response shape, going well beyond what the schema provides.

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 compact and front-loaded: purpose first, then routing advice, then parameter syntax, then runtime behavior and return format. Every clause contributes useful information 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?

Since there is no output schema, the description provides the full JSON return structure. For a two-parameter tool with chunking, progress, and cleanup behaviors, all the context needed to invoke it correctly is present.

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

Parameters5/5

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

Schema description coverage is 0%, so the description needed to carry parameter meaning, and it did. It defines path as a local PDF file path and pages with concrete 1-indexed closed-interval examples: all, 5, and 3-10. This fully compensates for the bare 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?

The description opens with a concrete action and resource: OCR a PDF file and return Markdown. It also explicitly addresses the main sibling by directing very large PDFs to start_pdf_ocr, so the tool's scope is unambiguous.

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?

The description gives explicit when-to-use guidance: small files should call this tool directly, while very large PDFs should use the async sibling start_pdf_ocr. It also defines valid page-range syntax, giving an agent concrete invocation conditions.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/stellarum-J/glm-ocr-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server