Skip to main content
Glama

harmonize_markdown

Idempotent

Normalize Markdown formatting by converting headers to ATX style, standardizing list markers to dashes, and enforcing fenced code blocks. Returns consistent syntax or saves to file.

Instructions

Standardize and normalize Markdown syntax without changing the document's meaning. Re-formats headers (ATX-style), normalizes list markers to '-', enforces fenced code blocks with backticks, and applies consistent indentation. Side effects: when output_path is provided, writes the harmonized Markdown to disk (creates parent directories as needed, overwrites existing files). When output_path is omitted, returns the harmonized text as a string with no file I/O. Returns: harmonized Markdown string (if no output_path), or JSON with { success, file_path, file_size_bytes, format } (if output_path set). Use this tool when you need to clean up inconsistent Markdown formatting before further processing. Prefer convert_to_md with harmonize=true if you also need to save the result, as it combines both steps. Not suitable for converting Markdown to other formats — use the convert_to_* tools instead.

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.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.
Behavior4/5

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

Annotations declare idempotency and non-destructive nature; the description adds crucial behavioral specifics: exact formatting mutations (ATX headers, '-' list markers, fenced code blocks), file I/O side effects (directory creation, overwriting), and conditional return value schemas (string vs JSON object). This significantly augments the annotation-level safety profile with operational details.

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 logical flow: purpose → specific behaviors → side effects → returns → usage guidance → alternatives → exclusions. Every sentence provides unique value (normalization specifics, I/O behavior, return types, sibling distinctions). Slightly dense but efficiently packed with necessary information for a dual-mode tool (in-memory vs file-write).

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?

Excellently compensates for the missing output schema by explicitly documenting both return variants (harmonized string vs JSON summary with specific fields). Covers input requirements (GitHub-Flavored Markdown, KaTeX), side effects, and error-prone conditions (overwriting) ensuring the agent has complete operational context.

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?

With 100% schema description coverage, the baseline is 3 per rubric. While the description elaborates on output_path behavior in the side-effects section (linking it to file writes vs string returns), the schema already documents the parameter purposes adequately. The description does not need to compensate for schema gaps.

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 opens with a precise action ('Standardize and normalize Markdown syntax') and scope ('without changing the document's meaning'). It immediately distinguishes itself from siblings by stating 'Not suitable for converting Markdown to other formats — use the convert_to_* tools instead' and explicitly comparing to convert_to_md, satisfying the requirement for sibling differentiation.

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 need to clean up inconsistent Markdown formatting before further processing'), explicit preference ('Prefer convert_to_md with harmonize=true if you also need to save the result'), and clear exclusions (not for converting to other formats). This covers all dimensions of usage guidance.

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