Extract Text
document.extract_textExtract raw text from base64-encoded PDFs or images for AI analysis such as summarization, claim checking, or structured extraction. Returns page count and text content.
Instructions
Extract plain text from a PDF or image (base64-encoded). Use when you need raw text for downstream AI analysis (summarization, claim checking, structured extraction). For documents at a public URL, use url.extract instead (no base64 encoding needed). Returns: { pages: number, text: string } Example prompts:
"Extract the text from this scanned contract so I can search it."
"Give me the raw text from this PDF document."
"OCR this image and return the text content."
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": {
"document_base64": "<document_base64>",
"mime_type": "<mime_type>"
},
"name": "document.extract_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mime_type | Yes | MIME type of the document. Example: "application/pdf" for PDFs, "image/png" for PNG screenshots. | |
| document_base64 | Yes | Base64-encoded PDF or image bytes (max ~15 MB). Example: "JVBERi0xLjcNJeLjz9MNCj..." (truncated PDF base64) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| pages | Yes |