Skip to main content
Glama

Minify an HTML fragment

minify-html
Read-onlyIdempotent

Remove comments and compact whitespace in HTML fragments. Use for small, controlled HTML snippets, not full document compilation. Returns an HTML string; preserves pre, textarea, script and style contents. Regression-test rendered output.

Input Schema

NameRequiredDescriptionDefault
htmlYesOriginal HTML source as text, up to 4096 characters.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world behavior, so the safety profile is covered. The description adds genuine value beyond that: it states the return type ('Returns an HTML string'), discloses content-preservation guarantees (pre, textarea, script, style), and warns to regression-test rendered output — a real caveat for a transformer. It does not mention errors or size-limit failures, keeping it short of a 5.

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?

Three tight sentences with the core operation front-loaded and no padding. The closing 'Regression-test rendered output' is a terse imperative that earns its place as a caution, though it could be slightly more explicit about why output may differ.

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 one-parameter, no-output-schema tool the description is nearly complete: it covers scope, return type and preservation semantics. Only edge-case behavior (invalid HTML, input over the 4096 limit) is left unspecified.

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 a single parameter and 100% schema description coverage (the schema already documents 'Original HTML source as text, up to 4096 characters'), the schema carries the parameter burden. The description adds no syntax, encoding or escaping guidance for the html field, so the baseline 3 applies.

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 (remove comments, compact whitespace) and an explicit resource (HTML fragments), which cleanly separates it from the sibling minify-css, minify-js and minify-prompt tools. An agent can identify the operation without opening the schema.

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 a clear negative boundary ('not full document compilation') and scopes the tool to 'small, controlled HTML snippets', which matches the 4096-character cap. It stops short of naming a sibling alternative for the full-document case, so it is clear context without full alternative routing.

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