Skip to main content
Glama

Indirect Prompt-Injection, Invisible Unicode & Beacon Output Scrubber

sanitize_tool_output_stream
Read-onlyIdempotent

Sanitizes untrusted external tool or web-scrape output by removing invisible Unicode Tag characters, disarming tracking beacons, and blocking indirect prompt overrides before LLM context.

Instructions

Sanitizes untrusted external tool or web-scrape outputs by stripping invisible Unicode Tag characters (U+E0000), neutralizing Markdown tracking image beacons, and defusing indirect prompt overrides. Use when cleaning raw third-party tool outputs or scraped web text before inserting it into the LLM context window; for redacting personal identifiable information (emails, SSNs, keys) from outbound text, use redact_sensitive_pii instead. Read-only edge call (32 KB, 60 RPM): accepts 'raw_tool_output' (with enum defaults), uses '?demo=true' or L402 (15 sats); HTTP 400 if invalid.

Input Schema

NameRequiredDescriptionDefault
wrap_tagNoXML isolation wrapper applied around the sanitized text; defaults to 'tool_data' when omitted.
raw_tool_outputYesUntrusted text returned by an external tool, webhook, or web scraper.

Output Schema

NameRequiredDescriptionDefault
sanitized_outputYesCleaned text with invisible Unicode, tracking beacons, and overrides neutralized.
threats_neutralizedYesList of smuggling or injection vectors stripped from the input.
injection_risk_scoreYesThreat score from 0.0 to 0.99 prior to sanitization.
safe_for_context_ingestionYesTrue once the sanitized payload is safe to feed to the LLM.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.3

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description goes well beyond them by disclosing the 32 KB payload ceiling, 60 RPM rate limit, auth paths (?demo=true or L402 at 15 sats), and the HTTP 400 failure mode for invalid input. That is exactly the operational context an agent needs before calling a metered edge endpoint.

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?

Purpose, threats, usage, alternative, and operational limits are all front-loaded and each clause carries information. It is a dense semicolon-chained paragraph, however, and the trailing auth/error clause could be tightened without losing anything.

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?

An output schema exists, so return values need no explanation, and the description still covers the input contract, size and rate limits, payment path, and error behavior. Nothing material for correct invocation is missing given the annotations and schema richness.

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%, so both parameters are already documented in structured form, which sets the baseline at 3. The description only references 'raw_tool_output' and never explains wrap_tag or what the isolation wrappers mean for prompt safety, and the phrase "(with enum defaults)" attaches the enum to the wrong parameter, adding a small amount of confusion rather than meaning.

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 names a specific verb ("Sanitizes") and enumerates the exact threats removed: Unicode Tag characters U+E0000, Markdown tracking-image beacons, and indirect prompt overrides. It explicitly routes the PII case to the sibling redact_sensitive_pii, so an agent can separate this from the other ~90 tools without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the trigger condition precisely ("cleaning raw third-party tool outputs or scraped web text before inserting it into the LLM context window") and names the alternative for the adjacent use case ("for redacting personal identifiable information ... use redact_sensitive_pii instead"). Both when-to-use and when-to-use-something-else are explicit.

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

Deploy Server

Other Tools