tristanmanchester/agent-skills

extracting-mistral-ocr

>- Extracts text, tables, and images from PDFs (including scanned PDFs) using the Mistral OCR API. Use when user asks to OCR a PDF/image, extract text from a PDF, parse a scanned document, convert a PDF to Markdown, or extract structured fields from a document.

First seen Feb 27, 2026

Installation

$ npx skills add tristanmanchester/agent-skills --skill extracting-mistral-ocr

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from tristanmanchester/agent-skills · top by installs.

npx skills add tristanmanchester/agent-skills

Browse all from tristanmanchester/agent-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 3
Default branch main
Open issues 1
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Version0.1.0
CompatibilityRequires network access and a MISTRAL_API_KEY environment variable. Expects Python 3.9+ and the mistralai package.
Allowed toolsRead,Write,Bash(python:*)
More metadata
author
generated-by-chatgpt
version
0.1.0
api
mistral
default-model
mistral-ocr-latest

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,153 B
  • docs SUMMARY.md 288 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 88 installs

SKILL.md

Mistral OCR PDF extraction

Quick start (default)

Run the bundled script to OCR a local PDF and write Markdown + JSON outputs:

python {baseDir}/scripts/mistral_ocr_extract.py --input path/to/file.pdf --out out/ocr

Output directory layout:

  • combined.md (all pages concatenated)
  • pages/page-000.md (per-page markdown)
  • raw_response.json (full OCR response)
  • images/ (decoded embedded images, if requested)
  • tables/ (separate tables, if requested)

Workflow

  1. Pick input mode

- Local PDF (most common): upload via Files API, then OCR via fileid. - Public URL: OCR directly via documenturl.

  1. Choose output fidelity (defaults are safe for RAG)

- Keep table_format=inline unless the user explicitly wants tables split out. - Set --include-image-base64 when the user needs figures/diagrams extracted. - Use --extract-header/--extract-footer if header/footer noise hurts downstream search.

  1. Run OCR

- Use scripts/mistralocrextract.py to produce a deterministic on-disk artefact set.

  1. (Optional) Structured extraction from the whole document

- If the user wants fields (invoice totals, contract parties, etc.), provide an annotation prompt. - The OCR API can return a document-level document_annotation in addition to page markdown.

Example:

``bash python {baseDir}/scripts/mistralocrextract.py \ --input invoice.pdf \ --out out/invoice \ --annotation-prompt "Extract suppliername, invoicenumber, invoicedate (ISO-8601), currency, totalamount. Return JSON." \ --annotation-format json_object ``

Decision rules

  • If the PDF is local and not publicly accessible, upload it (the script does this automatically).
  • If the PDF URL is private or requires authentication, do not pass it as document_url; upload instead.
  • If output quality is critical, prefer table_format=html for downstream parsing over brittle regex.

Common failure modes

  • Missing MISTRALAPIKEY: set it in the environment before running.
  • URL OCR fails: the URL likely is not publicly accessible; upload the file.
  • Large files: upload supports large files, but very large PDFs may need page selection (--pages) or batch processing.

References

  • API + parameters: references/mistralocrapi.md
  • Output mapping rules (placeholders to extracted images/tables): references/output_mapping.md
  • Example annotation prompts for common document types: references/annotation_prompts.md