Skip to main content
Glama

Remove hidden Unicode from text

clean_text
Read-onlyIdempotent

Return the text with invisible characters, bidi controls, tag characters and control characters removed and unusual spaces turned into normal spaces. By default ZWJ/ZWNJ/VS16 are kept inside emoji sequences, between letters of joining scripts (Arabic, Persian) and after an Indic virama (keep_joiners=true); strict=true removes them everywhere. Optional: map lookalike letters to Latin (lookalikes) and apply NFKC normalisation (nfkc). Read-only. Same engine as GET /api/clean.

Input Schema

NameRequiredDescriptionDefault
nfkcNoApply Unicode NFKC first (fullwidth and math letters → plain).
textYesText to inspect (up to 2000 UTF-16 code units).
spacesNoTurn unusual spaces into a normal space.
strictNoStrict mode: remove every joiner and variation selector, even in emoji and Persian/Indic text (overrides keep_joiners).
lookalikesNoMap lookalike letters (e.g. Cyrillic а) to Latin. Changes legitimate non-Latin text too.
keep_joinersNoKeep ZWJ/ZWNJ/VS16 where they are legitimate: emoji ZWJ sequences and VS16 emoji presentation, between letters of joining scripts (Arabic, Persian), and after an Indic virama. Joiners elsewhere are always removed.

Output Schema

NameRequiredDescriptionDefault
textYes
notesNo
lengthNo
changedYes
optionsNo
removedYes
versionYes
joinersKeptNo
lookalikesMappedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the description's 'Read-only' line is redundant, but it adds real behavioural detail beyond annotations: exactly what is stripped, that ZWJ/ZWNJ/VS16 survive in emoji, joining scripts and after a virama by default, and that lookalikes will rewrite legitimate non-Latin text. That last point is a genuinely useful side-effect warning.

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?

Three front-loaded sentences that pack the default joiner policy first and the optional flags second; almost every clause carries information. The 'Read-only' clause restates an annotation and is the one piece of waste.

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 present, the description need not explain return values, and it adequately covers the default vs. strict joiner policy, the two opt-in transforms, and the risk of lookalike mapping. The only gap is guidance on choosing this tool over scan_text, which is a usage rather than completeness issue.

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 description coverage is 100%, so all six parameters are already documented, including the strict-overrides-keep_joiners interaction. The description restates the lookalikes and nfkc options without adding syntax or format detail beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise verb + resource: return the text with invisible characters, bidi controls, tag characters and control characters removed, plus space normalisation. That is far more specific than the name 'clean_text' alone. It does not, however, say how it differs from the sibling scan_text (detect vs. clean) or compare_names.

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?

Usage is implied by contrast with the siblings' names and by the option set (sanitise text before further processing), but there is no explicit when-to-use / when-not-to-use statement and no named alternative. 'Same engine as GET /api/clean' helps an agent that knows the HTTP surface, not one that only sees the tool list.

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