Skip to main content
Glama

convert_to_markdown

Read-onlyIdempotent

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

NameRequiredDescriptionDefault
offsetNoCharacter offset to start reading from (default 0). A truncated result ends with the offset of the next page.
filenameYesThe document filename to convert
max_charsNoMaximum characters to return (default 50000, at most 200000).

Output Schema

NameRequiredDescriptionDefault
textYesThe text of this page of the document
next_offsetNoOffset to pass on the next call; absent when this page reaches the end
total_charsYesLength of the whole text in characters

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.4.1
    • addedInput schema / properties / max_chars
      Added value: +{
      +  "default": 50000,
      +  "description": "Maximum characters to return (default 50000, at most 200000).",
      +  "maximum": 200000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Character offset to start reading from (default 0). A truncated result ends with the offset of the next page.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "next_offset": {
      +      "description": "Offset to pass on the next call; absent when this page reaches the end",
      +      "type": "integer"
      +    },
      +    "text": {
      +      "description": "The text of this page of the document",
      +      "type": "string"
      +    },
      +    "total_chars": {
      +      "description": "Length of the whole text in characters",
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "text",
      +    "total_chars"
      +  ],
      +  "type": "object"
      +}
  2. Addedv1.1.0

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the trailing "Read-only" adds nothing. What the description does add beyond the annotations is valuable: PDF heading detection and formatting, code-block wrapping for TXT/CSV, passthrough for MD, and paginated output capped at max_chars.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with purpose followed by format behavior and paging, with no filler. The closing "Read-only." is redundant with the annotations and is the one sentence that does not earn its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and the description covers the key behavioral questions (format handling, paging continuation). Minor gap: "any document" is overbroad given a list_formats sibling implies a limited supported-format set, and error behavior for unsupported inputs is unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so offset and max_chars are already fully documented in the schema. The description adds only the paging model ("pages of max_chars characters") which the schema's offset description also covers, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Convert a document to clean Markdown format") and enumerates format-specific output behavior for PDF, TXT/CSV, and MD. It does not clearly delineate the difference from the sibling read_document, which it only references as a paging analogue.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"Use this when you need structured, readable output from any document" gives a clear selection cue, and the per-format behaviors help an agent predict output. There is no explicit when-not guidance or named alternative (e.g., read_document vs convert_to_markdown), so it stops short of full routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.