Skip to main content
Glama

convert_to_docx

Idempotent

Convert Markdown text to Microsoft Word DOCX format with styled headings, lists, and code formatting. Generate editable Word documents from structured content for professional editing and distribution.

Instructions

Convert Markdown to a Microsoft Word DOCX file. Produces a binary .docx document with styled headings, bold/italic text, numbered and bulleted lists, and code formatting. This is a binary format — output_path should almost always be provided. Side effects: when output_path is provided, writes the DOCX binary to disk (creates parent directories, overwrites existing files). When output_path is omitted, returns a JSON object with { format: 'docx', file_size_bytes, hint, base64_preview } — the hint will tell you to re-call with output_path to save the file. Returns: JSON write-confirmation (if output_path set), or JSON binary-guidance object (if omitted). Use this for Word-compatible documents. Prefer convert_to_rtf for legacy word processors, convert_to_pdf for read-only distribution, or convert_to_html for web.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdownYesThe raw Markdown source text to convert. Supports GitHub-Flavored Markdown (tables, task lists, strikethrough) and KaTeX math expressions. Pass the full document content as a string, not a file path.
output_pathNoOptional. Absolute or relative file path (e.g. './output.docx') where the binary file will be saved. Parent directories are created automatically. If provided, the file is written to disk and a JSON summary with { success, file_path, file_size_bytes, format } is returned. If omitted, a JSON object with { format, file_size_bytes, hint, base64_preview } is returned — the hint will instruct you to call the tool again with output_path to save the file. Binary formats (DOCX) should almost always specify output_path.
Behavior5/5

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

Excellent disclosure beyond annotations: details side effects (writes binary to disk, creates directories, overwrites files), explains dual return modes (JSON confirmation vs JSON binary-guidance with base64_preview), and clarifies the re-call pattern when output_path is omitted. Complements annotations (readOnly=false, destructive=false) with specific I/O behavior.

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?

Well-structured progression: purpose → output characteristics → side effects → return values → usage comparisons. Each sentence provides distinct value. Minor verbosity in return value explanation could be tighter, but front-loading is strong and scannable.

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?

Despite no output schema, comprehensively documents both return structures (write-confirmation and binary-guidance objects). Adequately covers binary conversion complexity, file system interactions, and sibling tool landscape. No gaps given the tool's scope.

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 has 100% coverage with detailed parameter descriptions. Description adds critical usage context beyond schema: emphasizes that output_path is nearly mandatory for binary formats and explains the functional difference between providing vs omitting the parameter. Slight deduction for not adding semantic nuances to the 'markdown' parameter beyond schema definition.

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?

Clear specific verb ('Convert') with source and target resources (Markdown to DOCX). Explicitly distinguishes from 21 sibling conversion tools by specifying 'Word-compatible documents' and contrasting with RTF, PDF, and HTML alternatives.

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?

Provides explicit guidance on when to use ('Word-compatible documents') and clear alternatives ('Prefer convert_to_rtf for legacy... convert_to_pdf for read-only... convert_to_html for web'). Also specifies critical behavioral guidance that 'output_path should almost always be provided' for binary formats.

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

Install Server

Other Tools

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/XJTLUmedia/MCP_Markdown_Formatter'

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