Skip to main content
Glama
fastocr-org

FastOCR MCP server

Official
by fastocr-org

ocr_file

Extract text from a local PDF or image, or save a searchable PDF, using OCR. Large documents return a document ID that you use to fetch the result later.

Instructions

OCR a local PDF or image with FastOCR and return its text or save a searchable PDF.

Uploads the file, runs OCR and waits up to 45 seconds. With output='text' the text is returned; text longer than 20,000 characters is cut, and the full text is written to output_path or to .ocr.txt next to the input file. With output='pdf' the searchable PDF is saved to output_path or to .searchable.pdf next to the input file. Either default file replaces an earlier result with the same name. Each processed page uses one page of the account's balance; an image is one page. Large documents take longer: then this returns a document id, and get_document with the same output fetches the result. Never call ocr_file again for that file, which bills it again.

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path to a local PDF, PNG, JPG, JPEG, GIF, WebP or BMP file.
outputNo'text' returns the extracted text; 'pdf' saves a searchable PDF with a text layer.text
output_pathNoOptional absolute path for the result file. An existing file there is replaced.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

The description adds substantial behavioral context beyond the annotations: it uploads the file, waits up to 45 seconds, truncates returned text after 20,000 characters, writes default result files that replace earlier results, and bills one page of account balance per processed page, with images counting as one page. It also explains the large-document document-id behavior for get_document. There is no contradiction with the annotations.

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 front-loaded with the core purpose and then adds only operationally relevant details: timeout, truncation, output-file defaults, replacement behavior, billing, and the large-document path. It is dense but not padded, and each sentence contributes useful information for correct invocation.

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?

Given the complexity of OCR processing, file outputs, billing, timeout, and the document-id fallback, the description covers everything needed to call the tool correctly. The existence of an output schema means return-value details need not be spelled out, and the annotations plus description together provide a complete operational picture.

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 100%, so the baseline is 3, but the description adds operational meaning beyond the schema: output='text' truncates long text and writes the full text to output_path or a default <file>.ocr.txt, while output='pdf' saves to output_path or a default <file>.searchable.pdf and replaces existing files with the same name. This meaningfully clarifies how output and output_path behave.

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: OCR a local PDF or image with FastOCR and return text or save a searchable PDF. It is clear what the tool does, but it does not explicitly distinguish itself from the sibling tool ocr_pdf, so the agent may need to infer the boundary.

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?

The description gives clear usage guidance for output='text' vs output='pdf', explains the large-document fallback to get_document, and explicitly says never to call ocr_file again for the same file because it bills again. It does not, however, compare against the ocr_pdf sibling, leaving one relevant alternative unaddressed.

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