Skip to main content
Glama

ocr_pdf

Extract text from PDFs, detect corrupted fonts common in Brazilian court documents, and run OCR only on affected pages. Small files return full text; large files save to .txt with a summary.

Instructions

Extrai texto de um PDF. Detecta automaticamente fontes corrompidas (comum em PDFs judiciais brasileiros) e aplica OCR quando necessário.

Para PDFs pequenos (<=30 páginas), retorna o texto completo.
Para PDFs grandes, salva em .txt e retorna o caminho + resumo.

Args:
    pdf_path: Caminho absoluto do arquivo PDF.
    dpi: Resolução para OCR (150, 200, 300 ou 400). Default: 300.
    save_to_file: Forçar salvamento em arquivo .txt mesmo para PDFs pequenos.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dpiNo
pdf_pathYes
save_to_fileNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A4/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 behavioral burden and does substantial work: it discloses automatic corrupted-font detection, conditional OCR application, the <=30-page threshold, and divergent return behavior (full text vs .txt path + summary). It omits permission/authorization needs, failure behavior, and runtime cost, keeping it short of a 5.

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?

The opening sentence leads with the core action, and the small-vs-large behavior follows logically before the Args block. It is slightly list-like in the Args section but every line carries information; no filler sentences.

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?

An output schema exists, so return structure needn't be documented, yet the description usefully explains the two return modes. Given no annotations and a mutation-adjacent side effect (writing .txt files), the omission of error handling and file-write implications is a minor gap, but the definition is otherwise complete for calling the tool.

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 must fully document parameters, and it does: pdf_path is specified as an absolute path, dpi is given the allowed enum values (150/200/300/400) and its default, none of which appear in the schema, and save_to_file's override semantics are explained. It fully compensates for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('Extrai texto de um PDF') plus the differentiator that it auto-detects corrupted fonts and applies OCR when needed. It is clear what the tool does, but it never names or distinguishes itself from the sibling tools (ocr_image, batch_ocr, ocr_page), which is required for a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains internal OCR-triggering behavior and the small-vs-large PDF branching, which implies when the tool is relevant. However, it gives no explicit guidance on when to choose this over ocr_image or ocr_page, nor any exclusions or prerequisites. Usage is implied rather than stated.

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

Deploy Server

Other Tools