Skip to main content
Glama

Deterministic PII redact (email/phone/SSN/card/IP/IBAN/routing/secrets)

text_pii_redact
Read-onlyIdempotent

Deterministic PII detect-and-redact for untrusted text (tickets, chat logs, LLM prompts) before storage or model input. Finds email, phone, US SSN, credit card (Luhn), IP, IBAN (mod-97), US ABA routing, and secret prefixes (sk-, ghp_, AKIA…). Checksum-validated; no LLM/NER. Returns findings with offsets, placeholders, redacted copy and countsByType. Optional types= filter. POST JSON {text} max 32 KB (GET ?text= max 2,000). Errors: 400 bad input. PAID: $0.002 USDC per call on Base via x402 (MCP transport: retry with params._meta["x402/payment"]). Same tool over plain HTTP: POST /v1/text/pii-redact.

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_pii_redact"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes
typesNooptional comma list: email,phone,ssn,credit_card,ip,iban,routing,secret

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Well beyond the readOnly/idempotent annotations, it discloses the paid x402 model with exact price and the retry mechanism via params._meta["x402/payment"], payload limits (32 KB POST, 2,000 chars GET), the 400 error case, and validation behavior (checksum-verified, no NER). This is exactly the kind of context annotations cannot carry.

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?

Purpose and safety-relevant constraints are front-loaded, and every sentence carries information (detection list, return shape, limits, payment, alternate endpoint). It is dense to the point of being telegraphic in the "POST JSON {text} max 32 KB" fragment, but there is no filler.

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?

With no output schema, the description supplies the return contract (findings with offsets, placeholders, redacted copy, countsByType), which is essential for a two-parameter tool whose result shape is otherwise unknown. Payment and transport prerequisites are also covered, leaving no blocking gap for an agent to call it correctly.

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 50% (the required 'text' param is undocumented), and the description compensates by stating the 32 KB cap and the GET 2,000-char variant. It also explains the 'types' filter's purpose and enumerates allowed values in prose, adding meaning on top of the schema's own list.

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+resource ("deterministic PII detect-and-redact") and enumerates exactly what it detects (email, phone, SSN, card with Luhn, IP, IBAN mod-97, ABA routing, secret prefixes). It also distinguishes itself from the LLM-based alternative approach with "no LLM/NER", and is clearly separable from siblings like injection_scan.

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?

Gives concrete usage contexts (tickets, chat logs, LLM prompts) and the trigger point ("before storage or model input"), which is strong when-to-use guidance. It does not name a when-not-to-use condition or point to a sibling tool for non-PII sanitization (e.g., injection_scan), so it stops short of 5.

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