Convert text or data
convertConvert text or structured data that you already have as a string - JSON, YAML, CSV, HTML, Markdown or plain text - into Markdown or another format. Use this for inline content; for a file (PDF, Word, PowerPoint, Excel, Jupyter notebook, SRT/VTT subtitles) use convert_file, and for a web address use convert_url instead.
Parameters:
input (required): the content as a plain string, not base64. Empty or whitespace-only input returns an empty result.
source_format (default auto): with auto the format is detected in this order: SRT/VTT subtitles, JSON (a Jupyter notebook if it has cells and nbformat), HTML, CSV/TSV (at least two rows with the same number of columns, two or more), YAML, Markdown, and otherwise text. Because text only converts to markdown or html, an undetected table or data document fails for other targets - set source_format explicitly in that case.
target_format (default markdown): must differ from the source, including the detected one - Markdown input with the default target fails, so pick e.g. html or text. Allowed targets per source: json -> yaml, csv, markdown, html, text, excel, docx; yaml -> json, csv, markdown, html, text, excel, docx; csv -> json, yaml, markdown, html, text, excel, docx; markdown -> json, yaml, csv, html, text, excel, docx; html -> markdown, text; text -> markdown, html; detected notebooks and subtitles -> markdown. Converting Markdown to json, yaml, csv or excel uses its first table, else key: value lines or lists. An unsupported pair returns an error that names both formats.
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: nothing is stored, and the same input always gives the same output. 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": {
"input": "<input>"
},
"name": "convert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The content to convert, as a string (e.g. a JSON document, a CSV table or an HTML page). Empty input returns an empty result. | |
| 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. | |
| source_format | No | Format of input. Default auto: detected from the content, falling back to text when nothing matches (see the tool description for the detection order). Set it explicitly when detection could guess wrong, e.g. a one-line CSV, YAML-like prose, or Markdown without headings or lists. | |
| target_format | No | Format to convert to. Default markdown. Must differ from the (detected) source format and be allowed for it; the per-source list is in the tool description. excel and docx come back as an embedded binary resource, all others as text. |