Skip to main content
Glama

ScorpTech x402 Tools

Text Clean

text_clean
Read-onlyIdempotent

Clean and normalise messy text before embedding, indexing or prompting: repairs mojibake (UTF-8 read as Windows-1252), strips control and invisible characters (zero-width, bidi overrides used in Trojan Source attacks, soft hyphens, BOM), normalises exotic whitespace, curly quotes, dashes, ligatures and full-width forms, re-joins words hyphenated across line breaks, optionally unwraps hard-wrapped lines, strips HTML, decodes entities, removes emoji / URLs / emails, transliterates to ASCII or lowercases. Reports how many fixes of each kind were made. Offline; 500 KB. Returns JSON with: text, changed, changes, inputLength, outputLength. Price: $0.001 USDC per successful call (x402, Base or Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/text-clean

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "text_clean"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesText to clean
asciiNoTransliterate Latin accents to ASCII (é -> e)
fullwidthNoFull-width ASCII forms to ASCII
ligaturesNoExpand fi fl ff ffi ffl ſt st
lowercaseNoLowercase everything
stripHtmlNoRemove HTML tags (script/style content dropped)
removeUrlsNoRemove http(s) URLs
dehyphenateNoJoin words hyphenated across line breaks (infor-\nmation)
fixMojibakeNoRepair UTF-8 decoded as Windows-1252 (Café -> Café, ’ -> ’)
removeEmojiNoRemove emoji and pictographs
unwrapLinesNoJoin hard-wrapped lines inside paragraphs
removeEmailsNoRemove email addresses
stripControlNoRemove C0/C1 control characters (keeps tab / newline)
decodeEntitiesNoDecode HTML entities (&amp; -> &)
stripInvisibleNoRemove zero-width, bidi override (Trojan Source), soft hyphen and BOM characters
normalizeDashesNoEn / em / figure dashes and minus sign to "-"
normalizeQuotesNoCurly quotes / primes to ASCII quotes and … to ...
normalizeWhitespaceNoTabs and exotic spaces to plain spaces, collapse runs, trim lines, max one blank line

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the readOnly/idempotent/non-destructive annotations, it discloses the offline processing model, the 500 KB ceiling, that a per-kind fix count is reported, the exact JSON return keys, and the paid x402 access price and alternate HTTPS endpoint. The only tension is the annotations' openWorldHint=true against the description's 'Offline' claim, which I treat as a loose hint rather than a direct contradiction since the description otherwise describes a purely local transformation.

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?

One dense paragraph that front-loads the core purpose and the main repair categories before the operational details (offline, size limit, return shape, price, endpoint). It earns most of its length, though the pricing and URL tail could be split out for easier scanning.

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

Completeness5/5

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

For an 18-parameter tool with no output schema, the description supplies the missing pieces an agent needs: input size limit, default-on versus opt-in behaviour, a summary of the returned JSON fields, and the paid-call requirement. Nothing essential to correct invocation appears to be missing.

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 18 flags are already documented with defaults and examples in the schema. The description's prose summarises the same categories (mojibake, invisible chars, quotes, ligatures, HTML, emoji/URLs/emails, ASCII transliteration) without adding new meaning such as flag interaction order or override behaviour, so the 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?

The description uses concrete verbs (clean, normalise, repair, strip, transliterate) on a specific resource (text) and enumerates the exact transformations performed, plus the intended use cases (before embedding, indexing or prompting). This clearly separates it from siblings such as text_block, text_chunk or text_wrap, which reshape rather than sanitise text.

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?

It states the context in which to reach for this tool ('before embedding, indexing or prompting') and flags which normalisations are on by default versus opt-in via the schema defaults. It does not name an alternative or state when not to use it (e.g. when text is already clean or when only measurement is needed), so it falls short of full routing 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.

Resources