Skip to main content
Glama

convert_to_md

Idempotent

Save Markdown to files with optional formatting normalization, or return standardized text with consistent syntax for headers, lists, and code blocks.

Instructions

Export Markdown content, optionally harmonizing its formatting first. When harmonize=false (default), returns the input Markdown unchanged. When harmonize=true, applies the same normalization as harmonize_markdown (ATX-style headers, '-' list markers, fenced code blocks, consistent indentation) before returning. Side effects: when output_path is provided, writes the Markdown to disk (creates parent directories, overwrites existing files). When output_path is omitted, returns the Markdown string directly. Returns: Markdown string (if no output_path), or JSON { success, file_path, file_size_bytes, format } (if output_path set). Use this when you want to save Markdown to a file (with or without cleanup). Prefer harmonize_markdown if you only want to normalize formatting without saving to disk. Use the convert_to_* family for other output formats.

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.
harmonizeNoOptional. When true, normalizes Markdown syntax (ATX headers, '-' list markers, fenced code blocks, consistent indentation) before returning or saving. When false or omitted, the Markdown is passed through unchanged. Defaults to false.
output_pathNoOptional. Absolute or relative file path (e.g. './output.txt') where the result will be saved. Parent directories are created automatically. If omitted, the converted text content is returned directly in the response as a string. If provided, the file is written to disk and a JSON summary with { success, file_path, file_size_bytes, format } is returned instead.
Behavior5/5

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

Annotations indicate write capability (readOnlyHint=false) and idempotency, but description adds crucial behavioral details: file system side effects (creates parent directories, overwrites), dual return modes (string vs JSON), and specific normalization rules applied (ATX headers, fenced code blocks).

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?

Well-structured with clear information hierarchy: core purpose → parameter behavior → side effects → return values → usage guidance. Every sentence earns its place; no redundancy despite length.

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?

Excellent completeness given no output schema exists. Describes both return formats (string vs JSON structure), covers all parameters including optional behaviors, and documents side effects. Appropriate for a tool with dual output modes and file system interactions.

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 establishing baseline of 3. Description adds valuable semantic context: relationship between 'harmonize' parameter and the standalone 'harmonize_markdown' tool, and the side-effect nature of 'output_path' (disk write vs direct return).

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?

Specific verb ('Export') and resource ('Markdown content') with clear scope. Explicitly distinguishes from sibling tools by referencing 'harmonize_markdown' and 'convert_to_* family', clarifying when to use each.

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 when-to-use ('when you want to save Markdown to a file'), when-not-to-use ('Prefer harmonize_markdown if you only want to normalize formatting without saving'), and clear alternatives (sibling tools named specifically).

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