convert_to_markdown
Convert documents into clean Markdown to produce structured, readable output, including detected PDF headings and paginated results for long files.
Instructions
Convert a document to clean Markdown format. Use this when you need structured, readable output from any document; for PDFs headings are detected and formatted, for TXT/CSV content is wrapped in code blocks, and MD files are returned as-is. Long output comes in pages of max_chars characters, like read_document. Read-only.
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": {
"filename": "<filename>"
},
"name": "convert_to_markdown"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | Character offset to start reading from (default 0). A truncated result ends with the offset of the next page. | |
| filename | Yes | The document filename to convert | |
| max_chars | No | Maximum characters to return (default 50000, at most 200000). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text of this page of the document | |
| next_offset | No | Offset to pass on the next call; absent when this page reaches the end | |
| total_chars | Yes | Length of the whole text in characters |