ocr_document
Force OCR text extraction from scanned PDFs when normal reading returns garbled or empty text; optionally target pages, languages, offsets, and character limits. Requires tesseract and pdftoppm.
Instructions
Force OCR text extraction on a PDF, bypassing normal text extraction. Use this when read_document returns garbled or empty text from a scanned PDF; requires tesseract and pdftoppm. Read-only.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filename": "<filename>"
},
"name": "ocr_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Optional page number to OCR (1-based). If omitted, OCRs all pages. | |
| offset | No | Character offset to start reading from (default 0). A truncated result ends with the offset of the next page. | |
| filename | Yes | The PDF filename to OCR | |
| language | No | Tesseract language code (default: DOCS_MCP_OCR_LANG, or "eng"). Use "spa" for Spanish, "fra" for French, etc. Run 'tesseract --list-langs' to see available languages. | |
| max_chars | No | Maximum characters to return (default 50000, at most 200000). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text of this page of the document | |
| next_offset | No | Offset to pass on the next call; absent when this page reaches the end | |
| total_chars | Yes | Length of the whole text in characters |