Skip to main content
Glama

Html Sanitize

html_sanitize
Read-onlyIdempotent

Sanitize untrusted HTML (LLM output, user comments, scraped pages, email bodies) with a strict allowlist before rendering it: three profiles (strict inline formatting, basic with links and lists, rich with images and tables) or a custom tag list; drops scripts, styles, iframes, forms, SVG/MathML, event handlers, javascript:/vbscript:/data: URLs and comments; adds rel="noopener noreferrer nofollow" (+ optional target=_blank) to links; returns clean HTML, a plain-text version and a report of everything removed. Price: $0.002 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/html-sanitize

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
profileNobasic
schemesNoAllowed URL schemes for href/src/cite
nofollowNo
allowTagsNoCustom allowlist (replaces the profile; dangerous tags are always removed)
linkTargetNonone
allowDataImagesNoPermit data:image/(png|gif|jpeg|webp) in img src

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?

Goes well beyond the readOnly/idempotent annotations by listing exactly what is stripped (scripts, styles, iframes, forms, SVG/MathML, event handlers, javascript:/vbscript:/data: URLs, comments), what link attributes are added, and what is returned (clean HTML, plain text, removal report). It also discloses the payment model and an equivalent HTTPS endpoint, which matters for invocation.

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-loads the core purpose and use cases, then behaviors, then pricing. It is dense but nearly every clause carries information; the density is justified for a 7-parameter security tool, though it could be broken into shorter sentences.

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 exists, yet the description states the return shape (clean HTML, plain-text version, removal report). Combined with the drop list, profile semantics, and payment details, an agent has everything needed to call it correctly.

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?

With only 43% schema description coverage, the description meaningfully compensates: it explains the three profiles, the custom tag-list override, scheme stripping, data-image handling, and link target behavior. It stops short of explicitly describing every parameter (e.g., the nofollow boolean and its default) so a 4 is appropriate.

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 (sanitize untrusted HTML) and enumerates the source contexts (LLM output, user comments, scraped pages, email bodies) it targets. It is clearly distinguishable from siblings like html_to_markdown or text_clean.

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?

Provides a clear when-to-use signal ('before rendering it') and explains the choice among three profiles plus a custom allowlist. It does not explicitly name alternative sibling tools or when-not to use it, so it stops short of a 5.

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