Extract Document Fields
document_extractTurn a document image into structured fields. doc_type picks the schema (receipt/invoice/id/contract/form/generic).
A page with no readable text returns an error rather than a guess.
Returns: dict with keys: doc_type (str), fields (dict — null for any value not present), text (str — the recognised plain text).
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": {
"image": "<image>"
},
"name": "document_extract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | Base64-encoded PNG/JPEG of a single document page | |
| doc_type | No | The document kind — picks the field schema: receipt | invoice | id | contract | form | generic | business_card | w2 | health_card | mortgage | pay_stub | generic |