Convert a document file
convert_fileConvert a document file to Markdown or another format. Use this for files: PDF, Word (.docx, .doc), PowerPoint (.pptx, .ppt), Excel (.xlsx, .xls), Jupyter notebooks (.ipynb) and SRT/VTT subtitles; text files (.json, .yaml, .csv, .tsv, .html, .md, .txt) work too. For content you already have as a string, use convert instead - it needs no base64 encoding; for a file at a public URL, use convert_url.
Parameters:
file_base64 (required): the whole file, standard base64 with padding (not URL-safe base64, not a path or URL). Invalid base64 returns an error.
filename (required): only its extension is used, case-insensitively, and it decides the source format - there is no separate source_format parameter. A wrong extension (e.g. report.pdf for a Word file) makes the conversion fail. Any other or missing extension, including .json, .yaml, .csv, .html, .md and .txt, falls back to detecting the format from the content, exactly like convert with source_format auto (unrecognised content becomes text).
target_format (default markdown): allowed values depend on the source format from filename: PDF and Word -> markdown, html, text; PowerPoint, notebooks and subtitles -> markdown only; Excel -> csv, json, yaml, markdown, html, text, docx (every sheet is included; in csv with several sheets, each one starts with a '# === Werkblad: ===' line); text files follow the convert tool's rules. An unsupported pair returns an error that names both formats; EPUB files are always refused (usually copyrighted e-books).
pretty_json (default false): only relevant for target_format json, and currently has no effect - JSON output is always indented with two spaces. Ignored for other targets.
Returns the converted content as text. excel and docx output is a binary file, returned as an embedded resource (base64 blob with its MIME type) instead of text.
Read-only: the file is processed in memory and not stored. Requires a slim-down API key or OAuth token; rate-limited per account (default 60 calls per minute).
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": {
"file_base64": "<file_base64>",
"filename": "<filename>"
},
"name": "convert_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Original file name including extension, e.g. report.pdf. The extension (case-insensitive) determines the source format, so it must match the actual content; an unrecognised or missing extension falls back to detecting the format from the content. | |
| file_base64 | Yes | The complete file content, standard base64-encoded (RFC 4648, with padding). Not a path or URL. | |
| pretty_json | No | Only meaningful when target_format is json. JSON output is always indented with two spaces, so true and false (default) currently give the same result; it is accepted for compatibility with the REST API. Ignored for every other target. | |
| target_format | No | Format to convert to. Default markdown. Allowed values depend on the source format derived from filename; the per-type list is in the tool description. excel and docx come back as an embedded binary resource, all others as text. |