Skip to main content
Glama

ScorpTech x402 Tools

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. Returns JSON with: html, text, changed, removedElements, removedAttributes, unsafeUrls, inputLength, outputLength. Price: $0.002 USDC per successful call (x402, Base or 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.3/5.0
Behavior5/5

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

Beyond the annotations, it discloses the exact security behavior: allowed profiles, dropped dangerous elements and URL schemes, link rel rewriting, optional target handling, and the returned report fields. It also states pricing and an HTTPS endpoint, which are important invocation details.

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?

The description is dense and front-loaded, with the main purpose and safety behavior stated immediately. It is longer than typical, but most detail is relevant for a security-sensitive sanitizer; there is slight redundancy between the general return summary and the explicit JSON field list.

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 7-parameter security tool with no output schema, the description covers the main behavior, return shape, and payment model well. It is still missing explicit semantics for some parameters and does not describe failure behavior, but it is broadly complete for correct invocation.

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?

The description explains the profile choices, custom allowlist behavior, and link target behavior, which adds meaning beyond the schema. However, with only 43% schema description coverage, it leaves the schemes parameter, nofollow toggling, and allowDataImages exception semantics under-explained.

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?

The description states a specific verb and resource: sanitize untrusted HTML using an allowlist before rendering. It distinguishes this from sibling tools such as html_select, html_tables, and html_to_markdown by focusing on security-oriented cleanup rather than selection, extraction, or conversion.

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?

It gives clear usage contexts, including LLM output, user comments, scraped pages, and email bodies, and says to use it before rendering. It does not explicitly name alternatives or when-not-to-use conditions, so it stops short of full routing guidance.

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