Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

normalize_whitespace

Read-onlyIdempotent

Normalize whitespace: trim trailing spaces, collapse blank lines, normalize line endings (LF/CRLF), convert tabs to spaces. Useful for cleaning code, configs, and text before processing.

Input Schema

NameRequiredDescriptionDefault
inputYesText to normalize
trim_fileNoTrim leading/trailing blank lines (default: true)
trim_linesNoTrim trailing whitespace from each line (default: true)
line_endingNo"lf" (default), "crlf", or "cr"
tab_to_spacesNoConvert tabs to N spaces (omit to keep tabs)
collapse_blanksNoCollapse runs of blank lines down to max_blank_lines (default: true)
max_blank_linesNoBlank lines to keep when collapsing, 0-10 (default: 2)

Output Schema

NameRequiredDescriptionDefault
resultNo
line_endingNo
original_lengthNo
normalized_lengthNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "collapse_blanks": true,
      +    "input": "a  \r\nb\t\r\n\r\n\r\n\r\nc",
      +    "line_ending": "lf",
      +    "max_blank_lines": 1,
      +    "trim_lines": true
      +  }
      +]
  2. Changed2 schema fields changed
    • changedInput schema / properties / collapse_blanks / description
      Previous value: -"Collapse 3+ consecutive blank lines to 2 (default: true)"New value: +"Collapse runs of blank lines down to max_blank_lines (default: true)"
    • addedInput schema / properties / max_blank_lines
      Added value: +{
      +  "description": "Blank lines to keep when collapsing, 0-10 (default: 2)",
      +  "type": "number"
      +}
  3. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "line_ending": {},
      +  "normalized_length": {
      +    "type": "number"
      +  },
      +  "original_length": {
      +    "type": "number"
      +  },
      +  "result": {}
      +}
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  5. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so safety is covered. The description adds real value by enumerating the specific mutations applied, though it omits that these are individually toggleable and what the defaults are (those live in the schema).

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

Conciseness5/5

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

Two sentences, zero waste, with the concrete operations front-loaded and the usage note trailing. Nothing is repeated from structured fields.

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 and full param descriptions, the definition is essentially complete. The only shortfall is that the interaction between options (e.g. collapse_blanks + max_blank_lines, trim_file vs trim_lines) is left entirely to the schema.

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 the baseline is 3. The description touches on tab conversion and line endings but adds no syntax detail beyond the schema – notably it says "convert tabs to spaces" while the schema specifies an N count and that omitting it keeps tabs.

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?

States a specific verb (normalize) and resource (whitespace) and enumerates the exact transformations: trailing spaces, blank lines, line endings, tabs. An agent can distinguish this from siblings like sort_lines, strip_markdown, or format_json without opening any schema.

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?

"Useful for cleaning code, configs, and text before processing" gives a usage context, but it names no alternatives and no exclusions. With siblings such as strip_markdown or sort_lines that also mangle text, the agent gets implied but not explicit selection guidance.

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.