Skip to main content
Glama

Escape / unescape text

text_escape
Read-onlyIdempotent

Escape or unescape text for JSON, HTML, URL, SQL, CSV, regex, shell, C/C++, Java, and Unicode targets, with options for quoting, delimiters, and output formats.

Instructions

Escape or unescape a string for a target: JSON (string body), JavaScript (incl. template literals), HTML, XML, URL (encodeURIComponent, optional form +), SQL (doubled quotes, optional MySQL backslashes and wrapping quotes), CSV field (RFC 4180; comma, semicolon or tab), regex, POSIX shell single quotes, C/C++, Java/C#, and Unicode escapes (\uXXXX, \u{X}, \UXXXXXXXX, &#xX;, U+XXXX). Options per target as on the website. Set "allTargets" to get the escaped form for every target at once. Web version: https://s3eidat.github.io/text-escape/

Input Schema

NameRequiredDescriptionDefault
formNourl: form style, + for spaces.
textYesThe text to escape, or the escaped text to unescape.
wrapNosql: wrap in single quotes (unescape: strip them).
asciiNojson/js/html/c/java: also escape non-ASCII characters (c: as UTF-8 octal).
everyNounicode: escape every character, not only non-ASCII.
mysqlNosql: escape backslashes too (MySQL).
namedNohtml (with ascii): prefer named entities such as ©.
targetYesFormat: json, js, html, xml, url, sql, csv, regex, shell, c, java, unicode.
delimiterNocsv: field delimiter (comma, semicolon or tab).,
directionNoescape (default) or unescape.escape
allTargetsNoescape only: also return the text escaped for every target.
alwaysQuoteNocsv: always quote the field.
unicodeFormatNounicode: u4 = \uXXXX (JS, JSON, Java), ubrace = \u{X} (ES6, Rust, Swift), u8 = \UXXXXXXXX (Python, C), html = &#xX;, uplus = U+XXXX.u4

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, and closed-world behavior, so the safety profile is covered. The description adds genuinely useful context (per-target option semantics, the allTargets fan-out mode) but defers key behavior to 'as on the website', which an agent inside the tool call cannot consult, and it omits error behavior for invalid escapes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The target list is front-loaded and useful, but the single run-on paragraph packs twelve formats plus options into one sentence and includes low-value filler like 'Options per target as on the website' and the external website URL, which do not help an agent invoke the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description only partially compensates: it explains the allTargets return shape but never states that a normal call returns the single escaped/unescaped string, nor how errors (e.g. malformed escape sequence on unescape) are surfaced. For a 13-parameter tool this leaves a meaningful gap.

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 100%, so the baseline is 3; the description nudges above it by mapping targets to their characteristic options (JSON string body, SQL doubled quotes, CSV RFC 4180, unicode formats \uXXXX vs \UXXXXXXXX) in a way that orients the reader before they read the schema. It adds no new per-parameter meaning beyond the schema, keeping it from a 5.

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 (escape/unescape), the resource (a string), and enumerates the exact target formats supported. An agent can immediately tell this is a general-purpose escaper and distinguish it from narrower siblings like url_encode or base64_encode.

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?

It states that `allTargets` produces output for every target at once and defaults `direction` to escape, which is light usage guidance. However, it never says when to prefer this tool over sibling utilities such as url_encode, url_decode, or sql_format, and offers no exclusions or prerequisites.

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