Skip to main content
Glama

html sanitize

html_sanitize
Read-only

Make untrusted HTML safe to display: an allow-list sanitiser removes scripts, styles, iframes, forms, event handlers and javascript: URLs, keeps formatting, links (rel=nofollow noopener) and optionally images. Costs $0.002 USDC per call (x402).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "html": "<html>"
    },
    "name": "html_sanitize"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlYes
imagesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint; the description adds substantial behaviour beyond that: exactly which constructs are stripped, which are preserved, the rel=nofollow noopener rewriting of links, optional image handling, and a per-call cost of $0.002 USDC (x402). An agent knows the transformation contract before calling.

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 sentences, front-loaded with the core purpose and the removal/preservation lists, closing with the cost. Every clause conveys actionable information; no filler.

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 simple 2-parameter transformation tool with no output schema, the description covers behaviour, preservation rules, and pricing well, but never states what is returned (presumably the sanitised HTML) or behaviour on malformed input. Minor gaps only.

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 description coverage is 0% for 2 parameters, so the description must carry the load; it only implicitly addresses 'images' via 'optionally images' (suggesting images are stripped by default) and adds nothing about the required 'html' input. Helpful but incomplete relative to the coverage gap.

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+resource (sanitise untrusted HTML) with a precise scope: allow-list removal of scripts, styles, iframes, forms, event handlers, and javascript: URLs, while preserving formatting, links, and optionally images. That is clearly distinguishable from siblings like html_tables, scrape, or markdown.

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 opening phrase 'Make untrusted HTML safe to display' implies the use case, but it never states when to choose this over alternatives (e.g. html_tables, scrape, moderate, markdown) or any preconditions/exclusions. Usage is inferred rather than declared.

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