Skip to main content
Glama

util_escape

Read-only

Escape / unescape for 15 contexts — Escape (mode=encode, default) or unescape (mode=decode) text= for every context an agent pastes strings into: html, html_attr (OWASP attribute encoding), xml (strips XML-illegal control chars), url (strict RFC 3986), url_form (+ for spaces), uri, json, js (single-quoted literal, script-safe), shell (POSIX quoting), powershell, sql (ANSI literal, backslash/NUL warnings), sql_like (% _ escaping), csv (RFC 4180 + formula-injection flag and excel_safe variant), regex, markdown. to= limits contexts (comma list). Decode handles named/numeric HTML entities, percent-encoded UTF-8 (malformed counted), JSON and JS escapes incl. u{...} code points, POSIX shell words incl. $'...', SQL/CSV quote doubling, and auto-detects multi-layer URL/HTML encoding (double_encoded flag, fully_decoded). Offline, max 20,000 chars. Price: $0.001 USDC (Base, via x402).

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": {
      "text": "<text>"
    },
    "name": "util_escape"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesO'Brien & <Sons>

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses offline operation, a 20,000-character cap, per-context quirks (xml strips illegal control chars, sql flags backslash/NUL hazards, csv flags formula injection and offers excel_safe), decode-side behaviors (malformed UTF-8 counted, double_encoded/fully_decoded flags), and an x402 micropayment cost. The paid nature and limits are exactly the operational facts annotations cannot convey.

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 verb, the 15-context scope, and the mode default before descending into per-context details, and every clause carries concrete technical information rather than filler. It is dense and comma-chained rather than cleanly sectioned, which costs readability on a long definition.

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 one-input tool with no output schema, it supplies enough decode-result semantics (named/numeric entities, multi-layer detection, malformed counts) plus limits and pricing to call it responsibly. The gap is the unresolved mode/to versus schema mismatch, which leaves an agent unsure how to actually target a specific context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explains mode=encode/decode and to= (comma list of contexts) in detail, but the input schema exposes only a single required 'text' property with no mode or to fields. Advertising parameters the schema does not define risks failed or ignored arguments, which is a material semantics problem despite the schema's nominal 100% coverage.

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?

Names a specific verb pair (escape/unescape) and a specific resource scope (text for 15 named contexts), immediately distinguishing it from sibling utilities like util_base64 or util_csv. The enumerated context list makes the tool's domain unmistakable 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 Guidelines4/5

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

Gives a clear applicability statement ('for every context an agent pastes strings into') and states the default direction (mode=encode, default), so an agent knows the common case. It does not, however, tell the agent when to prefer a different tool or when escaping is unnecessary, so exclusions are absent.

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