Skip to main content
Glama

convert_markdown_to_docx

Convert Markdown to Word with Chinese government document formatting. Optionally generate revision suggestions for quality and compliance.

Instructions

Convert a Markdown file to Word (.docx) with formatting.

Applies Chinese government document formatting (公文格式规范) by default:

  • Headings: 黑体 (H1 三号16pt, H2 小三15pt, H3 四号14pt) bold, left-aligned

  • Body: 仿宋_GB2312 四号14pt, justified, 2-char first-line indent

  • Tables: 仿宋_GB2312 五号10.5pt, center-aligned

  • Line spacing: fixed 28pt for body/headings, single for tables

Args: input_path: Absolute path to the input Markdown file. output_path: Output .docx path. Defaults to /.docx. format_spec: Path to a format description markdown file (like 格式要求.md). Overrides the default format. The file defines fonts, sizes, spacing, and alignment per Word style (H1/H2/H3/正文/表格). reference_docx: Path to a .docx template whose styles overlay on top of the format spec. Useful for matching an existing document's styles. extract_media: Directory to extract media files to. skip_format: If True, bypass ALL formatting (pure pandoc output). no_cache_template: If True, force regeneration of the cached reference template (needed when format spec changes). auto_suggest: If True, automatically generate a modification suggestions report (xx-修改建议.md) after conversion. The report covers heading hierarchy, required sections, format issues, content problems, list continuity, and Chinese punctuation.

Returns: Summary string with input path, output path, file size, and optionally the modification suggestions report path and issue count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_pathYes
format_specNo
output_pathNo
skip_formatNo
auto_suggestNo
extract_mediaNo
reference_docxNo
no_cache_templateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries full burden. It transparently discloses the default formatting behavior, the option to specify a custom format spec, reference docx overlay, and the ability to skip formatting entirely. It also explains caching behavior and auto-suggest report generation. However, it does not state if the operation is destructive, requires authentication, or has rate limits, though conversion tools typically are non-destructive and the output is a new file.

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?

The description is well-structured with a brief introductory sentence, detailed default formatting specs, then a clear parameter list with explanations. It is somewhat verbose in the formatting details but each section adds value. The parameter list is front-loaded after the formatting block, which is appropriate. Could be slightly more concise by reducing formatting specifics to a summary, but the detail is helpful for this domain.

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 complexity (8 parameters, 1 required), zero schema coverage, and the presence of an output schema (which is noted but not needed since the description explains the return value), the description is complete. It covers all parameters, provides usage context, explains default behavior, and describes the return value. The automatic detection of the output schema is not required due to the detailed summary documentation.

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

Parameters5/5

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

Schema description coverage is 0%, so the description completely compensates by documenting all 8 parameters with clear explanations of their purpose, defaults, and behavior (e.g., 'skip_format: If True, bypass ALL formatting (pure pandoc output)'). It adds meaning beyond the schema, such as the effect of 'no_cache_template' and the auto-suggest report details.

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 clearly states the tool converts Markdown to Word with formatting, identifies the default Chinese government formatting, and provides detailed style specs. It is specific about the verb ('Convert'), resource ('Markdown file to Word (.docx)'), and distinguishes from siblings like 'convert_markdown_to_xlsx' which converts to a different format.

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?

The description provides clear context for when to use this tool (converting Markdown to .docx with specific formatting) and explains the default formatting. It doesn't explicitly state when not to use it or mention alternatives among siblings, but the specificity of the conversion and the siblings (e.g., xlsx conversion, analysis) implies when this is appropriate. It could be improved by stating it's for Chinese government document formatting and not for simple conversions.

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/fengredrum/md2doc'

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