Document to Markdown (PDF, Office, HTML)
ai_documentUse when an agent must read a document it was handed: it turns it into clean Markdown in about a second - pass an https URL or base64 of a PDF, Word, Excel, PowerPoint, HTML, CSV or XML file and get the text back with its headings, tables and page markers, plus the token count. It reads the text layer, so a scanned page with no text layer comes back without text. You are only charged if the Markdown is delivered. No API key, no account. $0.01 per call, paid over x402 (USDC).
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": "ai_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | https URL of the document to convert. Use this or document. | |
| document | No | The document, as base64. Use this or url. | |
| filename | No | Name with extension, e.g. invoice.pdf. Helps the converter pick the parser. Default: taken from the URL. |