Skip to main content
Glama

diogenes-web-scraping-engine-mcp

Edge HTML Sanitizer, Script Stripper & XSS Neutralizer

sanitize_html_content
Read-onlyIdempotent

Sanitizes raw HTML or live URLs by removing malicious script tags, iframes, inline event handlers, and data URIs into safe markup. Accepts either 'url' to fetch directly or raw 'html_content' from upstream scrape_readable_article; for converting clean HTML into markdown, use extract_clean_markdown instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'url' or 'html_content' ('sanitization_strictness' defaults to 'strip_scripts_and_iframes'), supports '?demo=true' or L402 (10 sats), and returns HTTP 400 if invalid.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "sanitize_html_content"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoOptional web page URL to fetch and sanitize directly, bypassing an out-of-band fetch step.
html_contentNoUntrusted or potentially hazardous HTML string requiring sanitization.
preserve_imagesNoWhether to retain safe img elements with http/https sources.
sanitization_strictnessNoSanitizer filter policy: strip scripts and iframes, allowlist safe formatting, or plaintext strip all.

Output Schema

NameRequiredDescriptionDefault
sanitized_htmlYesSafe, purified HTML output free of active scripting threats.
elements_removedYesList of dangerous tags and attributes removed during processing.
xss_vectors_neutralizedYesCount of potential script execution vectors disarmed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / url
      Added value: +{
      +  "description": "Optional web page URL to fetch and sanitize directly, bypassing an out-of-band fetch step.",
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "html_content"
      -]
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only cover the safety profile (readOnly, idempotent, non-destructive), while the description adds the operational envelope an agent actually needs: 32 KB max payload, 60 RPM, stateless edge execution, L402 payment of 10 sats or '?demo=true', and an HTTP 400 on invalid input. That is meaningful context beyond the structured fields rather than a restatement of them.

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 core action and input choice are front-loaded in the first sentence, with constraints grouped afterward in a single dense parenthetical block. It is efficient but the second half is a run-on list of limits and payment modes that takes effort to parse.

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?

With an output schema, full annotations, and complete parameter coverage, the description fills the remaining gaps: limits, rate, error behavior, and payment mode. The one unresolved ambiguity is precedence when both 'url' and 'html_content' are provided, since neither is required.

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 description coverage is already 100%, so the baseline is 3; the description still adds value by disclosing that 'sanitization_strictness' defaults to 'strip_scripts_and_iframes', which the schema does not state. It does not explain 'preserve_images' or what happens if both 'url' and 'html_content' are supplied, keeping it from a top score.

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 ('Sanitizes raw HTML or live URLs') and enumerates exactly what is neutralized (script tags, iframes, inline event handlers, data URIs). The closing pointer to extract_clean_markdown makes the boundary with the sibling tools explicit.

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 concrete input-selection rule ('url' to fetch directly vs raw 'html_content' from scrape_readable_article) and names the alternative tool for the adjacent task of converting clean HTML to markdown. It lacks guidance on when sanitization is unnecessary or how it relates to other HTML siblings such as parse_html_tables, so it stops short of a full when/when-not treatment.

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