Skip to main content
Glama

repair_markdown

Idempotent

Repair broken Markdown from LLM outputs and copy-paste errors. Fixes unclosed code fences, malformed tables, broken links, and formatting inconsistencies to restore valid document syntax.

Instructions

Repair broken Markdown from LLM output or copy-paste. Fixes unclosed code fences, broken tables (mismatched columns, missing separators), stray emphasis markers, missing heading spaces, inconsistent list indentation, broken links, and excessive whitespace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdownYesThe potentially broken Markdown text to repair.
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 establish idempotency and non-destructive traits. The description adds valuable behavioral specifics beyond annotations by detailing exactly what constitutes 'repair' (mismatched table columns, missing heading spaces, etc.), clarifying the transformation scope without contradicting the safety hints.

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?

Two dense sentences with zero waste. The first establishes purpose and context; the second enumerates specific fixes. Every clause earns its place, and the information is appropriately front-loaded.

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

Completeness4/5

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

Given 100% schema coverage, idempotent annotations, and clear behavioral description, the definition is sufficiently complete. The lack of an output schema is partially mitigated by the parameter descriptions explaining the dual return modes (direct string vs. file write), though a brief summary of the return structure in the description would be ideal.

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?

Schema coverage is 100%, establishing a baseline of 3. While the description implies the input content domain ('broken Markdown' with specific defects), it does not explicitly elaborate on parameter syntax, format constraints, or the optional output_path behaviors beyond what the schema already documents.

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 uses a specific verb ('Repair') with a clear resource ('Markdown') and explicitly scopes the functionality to 'LLM output or copy-paste.' It comprehensively lists specific defects handled (unclosed code fences, broken tables, stray emphasis, etc.), distinguishing it from generic conversion tools in the sibling list.

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

Usage Guidelines3/5

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

It provides contextual usage hints by specifying the source ('LLM output or copy-paste'), implying when the tool is needed. However, it lacks explicit guidance distinguishing it from close siblings like 'lint_markdown' or 'harmonize_markdown' regarding when to repair versus lint or standardize.

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