Skip to main content
Glama

Mistral OCR (document to markdown)

mistral_ocr
Read-onlyIdempotent

Extract text from PDFs or images using OCR, returning structured markdown per page with support for tables, headers, footers, and annotations.

Instructions

Run Mistral OCR on a PDF or image, returning structured markdown per page.

Input document is one of:

  • { type: "document_url", documentUrl: "https://...pdf" }

  • { type: "image_url", imageUrl: "https://..." | "data:image/..." }

  • { type: "file", fileId: "" }

Options:

  • pages: array of 0-indexed page numbers or string like "0-5,7".

  • tableFormat: 'markdown' (default) or 'html'.

  • extractHeader / extractFooter: include page header/footer when present.

  • includeImageBase64: embed extracted image bytes as base64 in the response.

  • document_annotation_format: JSON schema for whole-document structured extraction.

  • bbox_annotation_format: JSON schema for extracted image / bbox annotations.

  • confidence_scores_granularity: 'page' or 'word'.

Returns pages[].markdown plus optional pages[].hyperlinks, header, footer, images bounding boxes, annotations, confidence scores, and dimensions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentYes
modelNoOCR model. Default: mistral-ocr-latest.
pagesNo
tableFormatNo
extractHeaderNo
extractFooterNo
includeImageBase64No
imageLimitNo
imageMinSizeNo
bbox_annotation_formatNo
document_annotation_formatNo
document_annotation_promptNo
confidence_scores_granularityNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagesYes
modelYes
pages_countYes
document_annotationNo
annotationsNo
usageNo
Behavior4/5

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

Annotations indicate read-only, idempotent, non-destructive behavior. Description adds behavioral context: document input variants, page filtering, optional annotations. No contradiction. The description adds useful details beyond annotations, such as return structure including markdown, links, and bounding boxes.

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?

Description is well-structured: one-sentence purpose, then bulleted input formats, then list of options, then return fields. No superfluous text; every sentence adds 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?

For a tool with 13 parameters, nested objects, and an output schema, the description covers all major aspects: input types, optional features, and return contents. It is complete enough for an agent to invoke correctly.

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 only 8%, but description explains the complex document parameter (three types) and many optional parameters (pages format, tableFormat, extractHeader, etc.). It adds meaning beyond the schema, compensating for low coverage.

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?

Description clearly states 'Run Mistral OCR on a PDF or image, returning structured markdown per page' with a specific verb and resource. Title reinforces the purpose. The tool is well-differentiated from siblings like mistral_vision and voxtral_transcribe.

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?

Description does not explicitly state when to use this tool versus alternatives (e.g., mistral_vision for image analysis, mistral_chat for general conversation). It implies OCR-specific use but lacks explicit exclusions or guidance.

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

Install Server

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/Swih/mistral-mcp'

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