Skip to main content
Glama

sanitize_untrusted_text

Read-onlyIdempotent

Strip hidden Unicode tags, bidi overrides, zero-width steganography, and hidden HTML/CSS prompt-injection payloads from untrusted text or local files, returning cleaned text, injection signals, and a nonce-wrapped envelope.

Instructions

Strip hidden Unicode Tag ASCII blocks (U+E0000..U+E007F), Trojan-Source bidi overrides, zero-width steganography, and hidden HTML/CSS prompt-injection payloads from untrusted text or a local file (<= 2 MiB), returning cleaned text, injection signals, and a nonce-wrapped envelope.

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_untrusted_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoPath to a local untrusted file (<= 2 MiB) to read and sanitize when `text` is omitted.
textNoRaw untrusted text or HTML to sanitize. Provide either `text` or `path`.
strip_htmlNoStrip HTML tags and decode entities after removing hidden DOM injection blocks.
source_labelNoShort provenance label recorded in the XML nonce wrapper (default: 'external').external

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already establish readOnly/idempotent/non-destructive/openWorld=false, and the description adds real context beyond them: a 2 MiB input cap, both input modes, and the three-part return payload (cleaned text, injection signals, nonce-wrapped envelope). It stops short of saying whether sanitization can silently drop content or how signals should be interpreted, but the added behavioral detail is substantial.

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?

A single dense sentence with the action front-loaded and each clause carrying distinct information (threat classes, input modes, size cap, return shape). It is long but nearly waste-free; a short lead-in separating 'what it strips' from 'what it returns' would improve scannability.

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 no output schema, the description correctly takes on return-value disclosure (cleaned text, injection signals, nonce-wrapped envelope) and states the size limit and dual input modes. For a 4-param, zero-required tool this is close to complete; the only gap is guidance on how to act on the reported injection signals.

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 coverage is 100% with per-parameter descriptions, defaults, and the 'provide either text or path' constraint already documented. The description reinforces the mutual exclusivity and the 2 MiB limit but adds no new syntax or format semantics for text, strip_html, or source_label. Baseline 3 applies when the schema carries the parameter burden.

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?

Specific verb ('Strip') plus an enumerated set of concrete threats (Unicode Tag ASCII U+E0000..U+E007F, Trojan-Source bidi overrides, zero-width steganography, hidden HTML/CSS injection payloads) acting on a clearly bounded resource (untrusted text or a local file <= 2 MiB). An agent knows exactly what class of operation this is without opening the schema.

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 phrase 'untrusted text' implies the intended context (sanitizing external content before further processing), but there is no explicit when-to-use/when-not-to-use statement and no named alternative among the sibling tools. Usage is inferable rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.