Skip to main content
Glama
ExaDev

document-mcp

by ExaDev

Convert document

convert_document

Convert documents between formats like docx, pptx, xlsx, odt, markdown, and pdf. Specify source and target format, with optional output path; check supported pairs first.

Instructions

Converts a document from one supported format to another via documents.js's DocumentConverter port -- docx, pptx, xlsx, odt, odp, ods, odg, odf, markdown, and pdf. Not every (source, targetFormat) pair is supported directly (odf, for instance, only ever converts to pdf); call list_document_conversions first to see which pairs actually are.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fontsNoExtra font faces to make available to the conversion, for a family the source document does not already embed. Only consulted by a conversion that runs a layout engine (a <format>-to-pdf conversion); every other conversion ignores this option entirely.
imagesNoA map from a markdown image destination (the part in the parentheses of ![](..)) to its base64-encoded PNG/JPEG bytes, for resolving a markdown source's own non-data: images. Only consulted by a markdown-sourced conversion; every other conversion ignores it. A destination absent from the map degrades to alt text, matching documents.js's own MarkdownImageResolver port -- an MCP caller has no filesystem context to read a relative path from, so any image that is not a data: URI must be supplied here explicitly to be embedded.
outputNoWhere to write the converted document. Omit entirely to receive the bytes inline, base64-encoded, instead.
sourceYesThe document to convert.
targetFormatYesThe format to convert the document to. Not every (source, targetFormat) pair is supported directly -- call list_document_conversions first to confirm this one is.
onSubstitutionDiagnosticsNoWhen true, additionally report each individual font-substitution event as structured fontSubstitutions (which family/weight/style was requested, what it resolved to instead, and why). Every substitution is always reported as a plain diagnostic in `diagnostics` regardless of this flag -- this only controls whether the fuller, structured event is also collected.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
outputYes
diagnosticsYes
targetFormatYes
fontSubstitutionsNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed3 schema fields changedv2.1.8
    • changedInput schema / properties / source / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "path": {
      -        "description": "Filesystem path to the document to read. The document format is inferred from the file extension.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "path"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "bytesBase64": {
      -        "description": "Base64-encoded document bytes.",
      -        "type": "string"
      -      },
      -      "format": {
      -        "description": "The document format of bytesBase64 -- required, since inline bytes carry no filename to infer it from.",
      -        "enum": [
      -          "docx",
      -          "pptx",
      -          "xlsx",
      -          "odt",
      -          "odp",
      -          "ods",
      -          "odg",
      -          "odf",
      -          "markdown",
      -          "pdf"
      -        ],
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "bytesBase64",
      -      "format"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "path": {
      +        "description": "Filesystem path to the document to read. The document format is inferred from the file extension.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "path"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "bytesBase64": {
      +        "description": "Base64-encoded document bytes.",
      +        "type": "string"
      +      },
      +      "format": {
      +        "description": "The document format of bytesBase64 -- required, since inline bytes carry no filename to infer it from.",
      +        "enum": [
      +          "docx",
      +          "pptx",
      +          "xlsx",
      +          "odt",
      +          "odp",
      +          "ods",
      +          "odg",
      +          "svg",
      +          "odf",
      +          "csv",
      +          "markdown",
      +          "pdf"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "bytesBase64",
      +      "format"
      +    ],
      +    "type": "object"
      +  }
      +]
    • changedInput schema / properties / targetFormat / enum
      Previous value: -[
      -  "docx",
      -  "pptx",
      -  "xlsx",
      -  "odt",
      -  "odp",
      -  "ods",
      -  "odg",
      -  "odf",
      -  "markdown",
      -  "pdf"
      -]New value: +[
      +  "docx",
      +  "pptx",
      +  "xlsx",
      +  "odt",
      +  "odp",
      +  "ods",
      +  "odg",
      +  "svg",
      +  "odf",
      +  "csv",
      +  "markdown",
      +  "pdf"
      +]
    • changedOutput schema / properties / targetFormat / enum
      Previous value: -[
      -  "docx",
      -  "pptx",
      -  "xlsx",
      -  "odt",
      -  "odp",
      -  "ods",
      -  "odg",
      -  "odf",
      -  "markdown",
      -  "pdf"
      -]New value: +[
      +  "docx",
      +  "pptx",
      +  "xlsx",
      +  "odt",
      +  "odp",
      +  "ods",
      +  "odg",
      +  "svg",
      +  "odf",
      +  "csv",
      +  "markdown",
      +  "pdf"
      +]
  2. Changed1 schema field changedv1.3.1
    • addedInput schema / properties / images
      Added value: +{
      +  "additionalProperties": {
      +    "type": "string"
      +  },
      +  "description": "A map from a markdown image destination (the part in the parentheses of ![](..)) to its base64-encoded PNG/JPEG bytes, for resolving a markdown source's own non-data: images. Only consulted by a markdown-sourced conversion; every other conversion ignores it. A destination absent from the map degrades to alt text, matching documents.js's own MarkdownImageResolver port -- an MCP caller has no filesystem context to read a relative path from, so any image that is not a data: URI must be supplied here explicitly to be embedded.",
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
  3. Addedv1.1.6

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It discloses that not all pairs are supported and that list_document_conversions should be consulted, which is helpful. However, it doesn't explicitly state side effects (like file writes) or the inline bytes behavior, though these are partly covered in the schema. Given no annotations, this is strong but could mention reversible or destructive aspects if any.

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

Conciseness5/5

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

The description is two sentences in the main text, with no filler. It front-loads the purpose and formats, then adds a crucial usage note. Every sentence earns its place, and the length is appropriate for the complexity of the tool.

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

Completeness5/5

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

Given the tool's complexity (6 params, nested objects, output schema), the description is complete: it covers supported formats, limitations, how to verify, and references the companion tool. The output schema exists, so return values need not be described. The description handles the core decision points an agent needs.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds value by explaining that images are only used for markdown-source conversions and that fonts are only used for layout engine (pdf) conversions, which goes beyond the schema descriptions. It also clarifies the output behavior (inline vs path) more explicitly. This takes it above baseline.

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

Purpose5/5

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

The description states a specific verb ('Converts') and resource ('document...via documents.js's DocumentConverter port'), lists supported formats explicitly, and distinguishes the tool from siblings by referencing list_document_conversions (a sibling that checks supported pairs). It clearly communicates what the tool does and how it differs from related tools.

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

Usage Guidelines5/5

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

The description explicitly instructs to call list_document_conversions first to confirm supported pairs, which provides when-to-use guidance and directs to the alternative tool. It also covers edge cases (odf only converts to pdf), giving clear usage context beyond the schema.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ExaDev/document-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server