Skip to main content
Glama

check_pdf_ocr

Analyze a PDF file to determine if it contains selectable text or is a scanned image. Returns flags indicating whether OCR is needed and if the PDF has a double-layer text overlay.

Instructions

判断一个已经传上去的 PDF 是不是扫描件(图片版)。PDF 传完就调它——看到「上传结果 HTTP 200」之后、提交翻译之前,把 objectKey 传进来。只有 PDF 需要,其他格式不用调。返回 isOcr=1 表示扫描件、翻译要走 OCR(扣的是 OCR 额度,和普通翻译不是同一本账,请把这点告诉用户),isOcr=0 是文本版 PDF;isDoubleDeck=1 表示双层 PDF(扫描图上盖了一层文字)——这种直接翻会翻到那层往往是错的文字上,返回的 msg 里会给出拍平工具的链接,请原样转述给用户,让他先拍平再重新上传。结果会被记住,随后 translate_document 直接复用、不会重复检测,也不用你把 is_ocr 填回去(检测只负责把扫描件标出来,不会去关掉别人显式打开的 OCR)。大文件可能要等十几秒到一分钟,那是服务端在下载并分析整个 PDF,属正常。测不出来时返回 code=500——那不影响提交,照常翻就是了。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_nameNo文件名,只用于返回里的可读说明,可不传
file_object_keyYes上传时拿到的 objectKey

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it excels. It discloses latency expectations ('大文件可能要等十几秒到一分钟'), explains that results are cached and reused, clarifies that the tool never turns off OCR explicitly enabled by others, and describes the code=500 case as non-fatal. It also explains quota implications and the double-deck PDF flattening flow.

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 description is long but dense and every sentence serves a purpose. It is front-loaded with the core purpose, then moves through call timing, format restrictions, return interpretation, downstream behavior, latency, and error handling. No filler or redundancy is present.

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?

There is no output schema, so the description correctly explains isOcr, isDoubleDeck, msg, and code=500. It also covers the complete workflow: when to call it, how to act on each result, whether to propagate OCR settings, and how to handle delays and errors. Nothing essential is missing for an agent to invoke this tool correctly.

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%, so the baseline is 3. The description mentions file_object_key contextually as the object key obtained from upload, and file_name is already described in the schema as an optional readable label. The description adds no additional parameter-level semantics beyond what the schema already provides.

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 specific verb and resource: '判断一个已经传上去的 PDF 是不是扫描件(图片版)' — it clearly states the tool's function of detecting whether an uploaded PDF is a scanned/image document. It also distinguishes itself from other file-handling tools by explicitly noting that only PDFs need this check.

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 precise when-to-use guidance: call it after the upload returns HTTP 200 and before submitting translation. It explicitly states that non-PDF formats do not need this call, and it explains how the result feeds into translate_document, including that no is_ocr value needs to be passed back. Alternatives and follow-up actions are fully covered.

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

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/zhang452064326/belindoc-mcp'

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