Skip to main content
Glama

Normalizar espacios

text-normalize-whitespace
Read-onlyIdempotent

Colapsa espacios, recorta líneas, normaliza saltos de línea y espacios Unicode. Cuándo: hay que transformar, comparar o medir un texto con exactitud y no por aproximación. No para: aplicar normalización Unicode NFC, NFD, NFKC o NFKD (unicode-normalize). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Collapses runs of spaces/tabs, trims each line, normalizes CRLF/CR to LF, converts non-breaking and other Unicode spaces to ASCII space and limits consecutive blank lines. When: text has to be transformed, compared or measured exactly instead of approximated. Not for: applying Unicode normalization form NFC, NFD, NFKC or NFKD and reporting whether the text changed (unicode-normalize). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
textYesInput text (string; required).
max_blank_linesNoMax consecutive blank lines (integer; optional; default 1; min 0; max 10).

Output Schema

NameRequiredDescriptionDefault
textNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / text / examples
      Added value: +[
      +  "  a   b \r\n\n\n\nc d  "
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Collapses runs of spaces/tabs, trims each line, normalizes CRLF/CR to LF, converts non-breaking and other Unicode spaces to ASCII space and limits consecutive blank lines. When: text has to be transformed, compared or measured exactly instead of approximated. Not for: applying Unicode normalization form NFC, NFD, NFKC or NFKD and reporting whether the text changed (unicode-normalize). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/openWorld=false, but the description adds real value beyond them: no network, no stored state, determinism, and concrete limits (64 KB input, 1 s per call, 1 MB output). One caveat: the stated 64 KB input cap sits awkwardly against the schema's maxLength of 262144 characters, which an agent could read as a conflict.

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-loaded with the exact behavior, then labeled When/Not-for/Side-effects/Deterministic/Limits sections. The bilingual duplication is somewhat costly, though the full English text is deferred to inputSchema.description rather than repeated inline.

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?

An output schema exists, so return-shape explanation is unnecessary, and the description covers behavior, exclusion, determinism and operational limits. The only gap is the tension between the stated 64 KB limit and the schema's 262144-character maxLength, which is left unreconciled.

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% and both parameters are fully documented in the schema (including max_blank_lines default 1, min 0, max 10). The description only alludes to the blank-line cap as part of the behavior, adding no syntax or edge-case detail beyond the structured field. Baseline 3 applies.

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 the exact transformations performed (collapse space/tab runs, trim each line, CRLF/CR→LF, Unicode spaces→ASCII, cap blank lines) rather than a vague 'normalize'. It explicitly distinguishes itself from the unicode-normalize sibling, so an agent can route between them without opening either 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?

Has explicit 'When' (exact transformation/comparison/measurement rather than approximation) and 'Not for' (Unicode normalization forms NFC/NFD/NFKC/NFKD, naming unicode-normalize as the alternative). The positive 'when' is a bit generic and other adjacent siblings (text-invisible-strip, text-dedent, text-indent) are not addressed, but the exclusion is decisive.

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