Skip to main content
Glama

Text cleaner

text_clean
Read-onlyIdempotent

Cleans text line by line by stripping HTML, removing emojis, trimming spaces, deleting empty/duplicate lines, sorting, reversing, shuffling, or numbering; optionally writes to a file.

Instructions

Clean up text line by line with a fixed pipeline (same order as the website): strip HTML tags and decode entities → remove emojis → trim each line → collapse repeated spaces → remove empty lines → remove duplicate lines (optionally ignoring case) → sort (A–Z, Z–A, natural, by length) → reverse → shuffle (seedable) → add line numbers. Returns the cleaned text plus counts, or writes it to a file when "output" is given. Give "text" or a text file "path". Web version: https://s3eidat.github.io/text-cleaner/

Input Schema

NameRequiredDescriptionDefault
pathNoOr: a path to a UTF-8 text file.
seedNoSeed for a reproducible shuffle (default: random).
sortNoSort lines: none (default), az, za, natural (item 2 before item 10), length (shortest first).none
textNoThe text to clean.
trimNoTrim spaces at the start and end of each line (default true).
outputNoOptional: write the cleaned text to this file path (or folder ending in "/") instead of returning it.
reverseNoReverse the line order (default false).
shuffleNoShuffle the lines (default false).
stripHtmlNoStrip HTML tags (drops script/style/comments, block ends become line breaks) and decode entities (default false).
ignoreCaseNoWhen removing duplicates, treat lines that differ only in case as duplicates (default false).
numberLinesNoPrefix each line with its number ("1. ", padded) (default false).
removeEmojiNoRemove emojis (©, ® and ™ are kept) (default false).
collapseSpacesNoCollapse runs of spaces/tabs into one space (default true).
removeDuplicatesNoRemove duplicate lines, keeping the first (default false).
removeEmptyLinesNoRemove empty (whitespace-only) lines (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior2/5

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

The pipeline ordering, the seed-for-reproducible-shuffle and the file-write behavior are all valuable disclosures that the annotations do not carry. However, two of them conflict with the annotation block: 'writes it to a file when "output" is given' is a side effect against readOnlyHint=true, and the default random shuffle (unless seed is set) makes repeated calls with identical arguments non-identical against idempotentHint=true. The disclosure is accurate and useful, which keeps this above 1, but the mismatch with the declared hints is a real safety signal an agent needs.

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 pipeline, then the return/write behavior, then input sourcing and the reference URL — a sensible order with no filler. The pipeline is delivered as one very long run-on sentence, which is dense but each clause is load-bearing (the ordering is the main information the schema lacks).

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 15-parameter, no-output-schema tool, the description covers what is returned ('the cleaned text plus counts'), what happens when 'output' is set, and the order in which options are applied. It does not address edge cases such as what counts are returned exactly or encoding/error behavior on a bad path, but nothing essential to making a correct call is missing.

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 coverage is 100%, so the baseline is 3 and the schema already documents each flag, including the ©/®/™ emoji exception and the natural-sort ordering. The description still adds value the schema does not: an either/or relationship between 'text' and 'path', the fixed execution order among the flags (which determines output when several are combined), and the return-vs-file behavior of 'output'.

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+resource (clean text, line by line) and enumerates the exact operation set, in execution order, so an agent can distinguish it from single-purpose siblings like text_case, text_slugify or text_replace-style tools. The closing line pins the parity with the website and the two input modes.

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?

States the input modes ('Give "text" or a text file "path"') and that output can go to a file, which is genuine routing guidance. It gives no when-not guidance and never names an alternative sibling (e.g. text_case or text_slugify) for single-operation transforms, so selection against the ~130 siblings is left to inference.

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