Skip to main content
Glama

Redact Text

redact_text
Read-onlyIdempotent

Use this when scrubbing test/dev text: replaces each occurrence of the given terms with block characters (████). Provide text plus terms (a comma-separated string or an array of strings). By default it matches whole words only using Unicode boundaries (so "ann" will not match inside "annual") and is case-insensitive; set caseSensitive to match exactly, wholeWords: false to match substrings, or fixedWidth: true to hide each term's length behind a constant-width bar. Returns the redacted text and a replacement count, and never echoes the original terms. Deterministic: same input, same output. Truly sensitive text is better redacted client-side at clean.tools/text-redact/. Example: {text: "Contact Jane Doe", terms: "Jane Doe"} -> redacted "Contact ████████", redactedCount 1.

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>",
      "terms": "<terms>"
    },
    "name": "redact_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text to redact terms from.
termsYesThe sensitive terms to redact, given either as a comma-separated string (e.g. "Jane Doe, jane@x.com") or an array of strings.
fixedWidthNoWhen true, replace every matched term with a constant-width block bar so the redacted length does not leak the original term length. Defaults to false (block length equals term length).
wholeWordsNoWhen true (default), only match terms as whole words using Unicode word boundaries (so "ann" will not match inside "annual").
caseSensitiveNoWhen true, match terms case-sensitively. Defaults to false (case-insensitive).

Output Schema

NameRequiredDescriptionDefault
redactedYesThe text with all matched terms replaced by block characters; identical to the input when no terms matched.
redactedCountYesThe number of replacements made.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "redacted": {
      +      "description": "The text with all matched terms replaced by block characters; identical to the input when no terms matched.",
      +      "type": "string"
      +    },
      +    "redactedCount": {
      +      "description": "The number of replacements made.",
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "redacted",
      +    "redactedCount"
      +  ],
      +  "type": "object"
      +}
  2. Added

TDQS

A5/5.0
Behavior5/5

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

Adds deterministic guarantee, never echoing original terms, default matching behavior (whole words, case-insensitive), and flags for caseSensitive and fixedWidth. Annotations already indicate read-only and idempotent; description reinforces and adds details.

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?

Single paragraph but well-structured: purpose first, then parameters, then behavioral details, then limitation and example. No wasted words, all sentences add value.

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?

Covers all aspects: purpose, parameters, behavior, determinism, return value (redacted text and count), and even a client-side alternative. Given the tool's complexity and existing output schema, description is fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Explains that terms can be comma-separated string or array, clarifies default boolean values, and provides an example. Schema coverage is 100%, but description adds significant meaning beyond schema by explaining behavior and usage.

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?

Description starts with specific verb 'replaces' and resource 'text', clearly stating it redacts terms by replacing with block characters. It distinguishes from sibling tools (text utilities) by focusing on redaction and even provides an external alternative for truly sensitive text.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use this when scrubbing test/dev text' and advises against using for truly sensitive text, directing to a client-side tool. Provides clear when-to-use and when-not-to-use context.

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