Skip to main content
Glama

HTML Formatter API - beautify or minify HTML

html_formatter
Read-onlyIdempotent

Format messy HTML with clean indentation (2 spaces, 4 spaces or tab) or minify HTML to a single compact string, with optional comment removal. Preserves script, style, pre and textarea content. Runs on our server, files are deleted right after the call, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €9/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.001/call via x402 at https://radarbg.com/x402/html-formatter.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mode": "beautify",
      "text": "<div><h1>Hello</h1><p>World</p></div>",
      "indent": "2"
    },
    "name": "html_formatter"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNobeautify or minifybeautify
textYesYour HTML markup
indentNoIndentation: 2, 4 or tab2
removeCommentsNoRemove HTML comments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, open world), and the description adds genuinely useful context beyond them: server-side execution, files deleted immediately with nothing stored, a 5 calls/day free tier, and two paid auth paths (X-API-Key and x402). It stops short of describing the response payload shape or failure behavior on invalid HTML.

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?

Front-loaded with what the tool does, then behavior, then commercial terms, in a tight sequence with little redundancy. The pricing URLs and tier details are dense but operationally necessary, so they largely earn their place.

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?

For a 4-parameter read-only tool with no output schema, the description covers modes, preservation guarantees, privacy, quota and auth — everything needed to call it. The one omission is what the response looks like, which matters slightly more given there is no output schema to fall back on.

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%, so all four parameters and both enums are already documented in the schema. The description restates the indent options and comment removal without adding format or edge-case detail, so it sits at the baseline. The 'preserves script, style, pre and textarea content' clause is the one piece of extra semantic value.

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?

Names a specific verb and resource: beautify (with 2/4/tab indentation) or minify HTML, plus optional comment removal. The resource is unambiguously HTML, which separates it from json_formatter, sql_formatter and markdown_html_converter without needing to name them.

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?

The two modes and their effect are clear, so an agent can infer when each applies, but there is no explicit 'use this instead of X' routing or precondition guidance such as size limits or whether malformed HTML is tolerated. Usage is implied rather than stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources