Parse document
parse_documentExtract structured fields from a PDF, PNG, JPEG, or text file sent as base64 in file_base64, or from plain text sent in text (10 MB and 10 pages on Free, 25 MB on paid; pages per document by plan: Starter 50, Pro 200, Business 500). 1 credit per page; an image is 1 page; text is 1 credit per 3,000 characters. Nothing is stored. Send exactly one of file_base64 or text. The result has status and values. Set citations to true to also get, for each value, the page, the printed text, and a box where it was read.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "parse_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | The document as plain text, for example a pasted invoice or email. 1 credit per 3,000 characters (started), at least 1. At most 30,000 characters on Free and 150,000 on paid plans. The text is not stored. Send this or file_base64, not both. | |
| schema | No | The slug of a layout saved in this workspace, or a literal layout object (sent in the `schema` JSON field). A layout is {"type":"object","properties":{...}}. Each property is {"type":T} where T is one of any, null, boolean, string, number, date, array, object. An optional description, at most 400 characters, tells the model how to read that key. An optional required array lists the keys that must be present. A date is a string yyyy-mm-dd. An array adds "items" (one node). An object adds "properties" and may add "required". At most 4 levels below the root, 100 keys, and 16384 bytes. | |
| strict | No | A long document is read in chunks of pages. By default a chunk that cannot be read leaves a partial result: status "partial", the pages that failed in failed_page_ranges, and credits only for the pages that were read. When true, any chunk that cannot be read fails the whole parse with CHUNK_FAILED (502) and no credits are used. Default false. | |
| citations | No | When true, the result also has citations: for each value's path, the page, the printed text it was read from, a box [x0, y0, x1, y1] on the page (0 to 1 from the top left), and a status saying whether the text was found in the document. Same credits. Default false. | |
| file_base64 | No | Base64-encoded PDF, PNG, JPEG, or UTF-8 text file (.txt, .md, .csv, .eml). At most 10 MB and 10 pages on Free, 25 MB on paid plans; pages per document are set by plan (Starter 50, Pro 200, Business 500). Each page costs 1 credit; an image is 1 page; text is 1 credit per 3,000 characters. The bytes are not stored. Send this or text, not both. |