Skip to main content
Glama

validate_html

Pre-flight check on html / css / js BEFORE writing via update_html. Returns { ok, errors, warnings, parsed } where parsed has byte counts per field and htmlDropped (true if the sanitizer would strip anything from html) plus htmlRemoved, the list of tags ({ tag, count }) and attributes ({ tag, attribute, count }) it would remove (capped at 25; htmlRemovedTruncated flags the cut). The same list appears in the html_sanitized warning. Errors cover cap breaches (html_too_large, css_too_large, js_too_large, total_too_large) and sanitizer rejection (html_sanitize_rejected, html_sanitize_empty). The sanitizer keeps <script> and <link>, but scripts do not run in html surfaces today (inline <script> and the js field are stored, never executed), so a passing check does not mean script-driven content will work: build static HTML/SVG/CSS. <canvas> and data-* attributes are kept. Still stripped: any tag or attribute off the allowlist — e.g. <iframe>, <object>, <embed>, <meta>, custom elements, inline on*= attributes, javascript:/data:text/html URIs. Read htmlRemoved rather than guessing. NEVER writes anything. Use when iterating on a payload so you don't burn a write on something the surface would reject.

Input Schema

NameRequiredDescriptionDefault
jsNoJS to validate (optional).
cssNoCSS to validate (optional).
htmlNoHTML to validate (optional).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it declares 'NEVER writes anything', enumerates the error codes returned (size caps, sanitizer rejection), documents the response shape including the 25-item truncation flag, and proactively discloses the important caveat that scripts are stored but never executed so a passing check does not imply script-driven content works. It also names concrete stripped constructs (iframe, object, embed, inline on*=, javascript: URIs).

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 purpose, then response contract, then behavioral caveats, then the usage trigger — a sensible priority order. It is dense and long, but with no output schema nearly every clause carries load-bearing information; a small amount of the enumeration could be trimmed without loss.

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?

No output schema and no annotations exist, yet the description fully specifies the return object, the failure modes, the truncation behavior, and the sanitizer's allowlist boundary — everything an agent needs to call this correctly and interpret the result.

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 the three optional string fields are already documented; the description adds value beyond that by tying the returned `parsed` byte counts and `htmlDropped`/`htmlRemoved` fields to the `html` field specifically and by mapping per-field size caps to named errors. It stops short of giving actual cap thresholds.

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 and resource ('Pre-flight check on html / css / js') and positions it precisely relative to the sibling write tool update_html. An agent can distinguish it from update_html or validate_doc_markdown/validate_formula without opening any 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 clear usage context — 'BEFORE writing via update_html' and 'Use when iterating on a payload so you don't burn a write' — and implicitly routes actual writes to update_html. It does not explicitly state exclusions (e.g. that a passing check is not a guarantee for scripts, which it does cover behaviorally, or when to skip validation entirely).

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.