Skip to main content
Glama

DeepSeek OCR

deepseek_ocr
Read-onlyIdempotent

Extract text from local PDF, Word, PowerPoint, and image files page by page, with optional rich-layout recognition that keeps cropped figures and normalized coordinate tags.

Instructions

用 DeepSeek 官方 OCR 接口识别本地 PDF/Word/PowerPoint/图片中的文字,按页返回。不调用对话模型,按成功页数计费(1.5 元/1000 页)。text_recognition 丢弃文档中的图、只要文字;rich_layout_recognition 会裁出图表并保留坐标标记(如 <|ref|>标题<|/ref|><|box|>[[52,40,948,96]]<|/box|>,坐标按页宽高归一化到 0–1000)。page_range 与 max_chars 都只在客户端生效,整篇仍会识别并按页计费。

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

Input Schema

NameRequiredDescriptionDefault
fileNo要识别的本地文件绝对路径。
filesNo同 file,可一次传多个(最多 5 个)。每个文件单独计费。file 与 files 二选一。
purposeNotext_recognition:只要文字,图表照片丢弃;rich_layout_recognition:保留裁出的图与坐标。text_recognition
max_charsNo单页文本的字符上限。
page_rangeNo只返回指定页码区间 [起始, 结束],1 起算、含两端。用于分页读取长文档。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover read-only/idempotent/non-destructive, but the description adds what annotations cannot: per-successful-page billing (1.5 RMB/1000 pages), that it does not invoke the chat model, and the crucial caveat that page_range/max_chars do not reduce cost because the whole document is still recognized and billed. This is exactly the kind of cost and side-effect context an agent needs.

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-loads the core capability, then modes, then the billing/client-side caveats; each sentence carries distinct, useful information. It is dense with no filler, though the parenthetical coordinate example adds length without much decision value.

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?

Even without an output schema, the description explains the return shape (page-by-page, coordinate markers normalized to 0-1000 by page width/height) and the billing behavior. For a 5-parameter, zero-required OCR tool, an agent has everything needed to call it correctly and predict cost.

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 goes beyond the schema by explaining that page_range and max_chars are client-side filters that do not change billing, which the enum/path descriptions alone do not convey. It also reinforces the purpose-mode semantics and the coordinate normalization scheme.

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+resource: recognize text in local PDF/Word/PowerPoint/images via DeepSeek's official OCR interface, returned page by page. It also distinguishes the two recognition modes, so an agent knows exactly what the tool does and how it differs from the ASR/fetch/search/tts siblings.

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 clear in-tool routing: choose text_recognition when only text is needed vs rich_layout_recognition when cropped charts and coordinates are required. It also warns that page_range and max_chars are client-side only, which affects the choice to page through long docs. It does not explicitly contrast against a sibling tool, keeping it just below a 5.

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