Skip to main content
Glama

HTML beautify / minify

html_format
Read-onlyIdempotent

Beautify or minify HTML with a forgiving tokenizer, preserving script/style/pre/textarea contents and normalizing attribute spacing. Accepts text or file path; optionally removes comments.

Instructions

Beautify (indent block elements, keep inline runs on one line) or minify HTML with a forgiving tokenizer: implied end tags (, , …), void elements, and , , , contents kept byte-for-byte. Whitespace between attributes is normalised; attribute values are never changed. Optional comment removal (IE conditional comments kept). Text only: nothing is rendered or run. Give "text" or a file "path". Web version: https://s3eidat.github.io/html-css-format/

Input Schema

NameRequiredDescriptionDefault
modeNo"beautify" (default) or "minify".beautify
pathNoOr: a path to a HTML file (UTF-8; use this for big inputs).
textNoThe HTML as inline text.
indentNoIndentation: 2, 4, "tab" (or any number of spaces 0-8).2
outputNoOptional: also write the result to this file path (or folder ending in "/"). The result text is then left out of the reply. Results over 1,000,000 characters are always written to a file.
removeCommentsNoDrop comments (IE conditional comments are kept).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Goes far beyond the readOnly/idempotent annotations: forgiving tokenizer with implied end tags, void elements, byte-for-byte preservation of script/style/pre/textarea, attribute whitespace normalisation but values untouched, and comment removal that keeps IE conditional comments. It also explicitly states nothing is rendered or executed, which is exactly the context an agent needs.

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 the two modes, then the tokenizer guarantees, then input sourcing. It is dense and semicolon-heavy but nearly every clause carries behavioural information; the trailing GitHub URL is the only non-essential element.

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?

With no output schema, the description carries return-value burden and does so partly: it explains when the formatted text is returned versus written to a file and the 1M-character threshold. Error cases and the exact reply shape when no output path is supplied are left implicit.

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 coverage is 100%, so baseline is 3, but the description adds real meaning: text vs path as alternative input sources, the IE-conditional exception to removeComments, and the output behaviour where the result is omitted from the reply and oversized results are always written to file.

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?

States a specific verb pair (beautify/minify) and resource (HTML) and immediately scopes the transformation rules. The HTML resource is unambiguous against formatting siblings like css_format, xml_format, json_format, and it is clearly not ai_html_to_markdown.

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?

Gives concrete invocation guidance: supply either inline "text" or a file "path", and the schema notes path is better for big inputs. It explains mode selection and optional output-to-file behaviour, but never names an alternative tool or a when-not-to-use condition.

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

Deploy Server

Other Tools