Title96/100
Read a document
The title clearly communicates the tool’s action and subject. Keep it concise.
Description92/100
OCR a PDF or image into Markdown, or into per-page records with `json_mode`. Use it when the value is the text on the page: invoices, forms, reports, slides, scans. The reply is one `<document>` element (`file_name`, `mimetype`, `npages`, `dpi`) that wraps one `<page>` per page in reading order, each with `id`, `width`, `height` and a `format` of `markdown` or `json`. Neither `method` nor `method_params` is needed for a plain read.
The description explains the capability, when to use it, and what to expect.
Inputs88/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
url
PDF or image: an http(s) URL, a data: URI, or base64.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
model
OCR model. `list_models` lists the served ones.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
dpi
PDF render DPI before OCR. Higher reads small text better but is slower.
Clear enough to supply this argument.
pages
0-indexed PDF pages to read; unset reads all. Each entry is an index or a half-open [start, stop] range; negatives count from the end. [0, 2] reads pages 0 and 2, [[0, 3]] reads 0-2, [-1] the last. Selected pages are renumbered from 0; indices past the end are ignored. One call reads at most 128 pages: for a longer PDF, call once per range and join the results. The error names the ranges.
Clear enough to supply this argument.
method
Method the model runs per page. Unset runs the model's default: `markdown` for generative OCR models, `ocr` for `paddleocr/pp-ocrv6`. `ocr` and `detect` usually return positioned regions, not prose. `list_models` lists each model's methods; others are refused.
Clear enough to supply this argument.
method_params
Keyword arguments for `method`, forwarded as-is; rarely needed (e.g. {"prompt": "Read the table."}). An unknown key is ignored, not refused: check the spelling.
Clear enough to supply this argument.
json_mode
False (default): a string. True: the parsed per-page records in `data`; use it to get boxes from a region method.
Clear enough to supply this argument.
Annotations100/100
All four behavior hints are declared.
{
"title": "Read a document",
"readOnlyHint": true,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}Output schema82/100
The output schema explains the structured result.
View output schema
{
"type": "object",
"properties": {
"cost": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Metered cost of this call in US dollars, if the gateway reports it."
},
"data": {
"title": "Data",
"default": null,
"description": "Parsed JSON when json_mode=true (the gateway's per-page/record payload or the transcription object); null otherwise, when the result is text/Markdown."
},
"text": {
"type": "string",
"default": "",
"description": "Extracted text — Markdown (documents), transcript (audio), or description (video). Empty when json_mode=true."
},
"model": {
"type": "string",
"default": "",
"description": "The model that actually produced this result."
},
"quota": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Free-tier allowance remaining for anonymous callers; null when a key was used."
},
"completion_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Completion id for this call (chatcmpl-… or transcription-…). Pass to get_completion for token usage and serving metadata."
}
},
"description": "The output of a ``read_*`` tool: extracted text plus provenance.\n\nThe tool's *content* is the clean text (Markdown / transcript / description);\nthis typed object is the parallel structured payload — so an agent can use the\ntext directly, or read ``data`` / ``model`` / ``cost`` / ``completion_id``\nprogrammatically. Token usage and fuller generation metadata live in\n``get_completion``."
}