Skip to main content
Glama

text_pii_mask

Read-only

PII and secret masking (deterministic) — Find and mask personal data and secrets in text before you log it, store it or send it to an LLM. Offline, no AI, nothing stored. Detects email, phone (US and international +), US SSN (SSA validity rules, or 9 digits after an SSN label), credit cards (Luhn + brand), IBAN (mod-97), IPv4/IPv6, MAC, labelled date of birth, US street addresses (heuristic), EIN, passwords in URLs, API keys (AWS, GitHub, Stripe, Slack, Google, OpenAI, Anthropic, GitLab, SendGrid, Twilio, npm, Hugging Face), JWTs and PEM private keys. text= (up to 100,000 chars), style=label (default, [EMAIL]) | numbered ([EMAIL_1], same value keeps the same number) | partial (a***@e***.com, ****-1111) | remove | hash (salted SHA-256 prefix, salt=), types= or exclude= comma lists, allow= values to leave untouched, return_map=true returns placeholder to original map so you can restore values after an LLM call. Returns masked text, per-type counts, findings with offsets, confidence and a preview, and a risk level NONE/LOW/MEDIUM/HIGH. Names are not detected: use /v1/ai/pii-redact for those. Price: $0.002 USDC (Base, via x402).

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>",
      "style": "<style>"
    },
    "name": "text_pii_mask"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesContact Ada at ada@example.com or (415) 555-0132, card 4111 1111 1111 1111, SSN 123-45-6789.
styleYesnumbered

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, the description discloses that the tool is deterministic, offline, non-AI, and stores nothing. It also explains detection rules such as Luhn, mod-97, SSA validity, style-specific behavior, return_map restoration, and risk levels.

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?

The description is front-loaded and dense, with no empty filler. It is still a long wall of text with exhaustive provider and detection lists, so scannability suffers slightly even though the information is relevant.

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 a complex masking tool, it covers detection scope, style behavior, restoration, output contents, risk levels, limitations around names, and cost. No output schema exists, and the description adequately explains what is returned.

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?

The input schema only exposes text and style with example values, while the description adds substantial meaning: the 100,000-character limit, style enum values including label, numbered, partial, remove, and hash, plus types, exclude, allow, salt, and return_map behavior. This compensates for a schema that is high-coverage only in a superficial sense.

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 states a specific verb and resource: find and mask PII and secrets in text. It distinguishes this deterministic masking tool from the AI-based sibling by noting that names are not detected and pointing to /v1/ai/pii-redact for that case.

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?

It explicitly says when to use it: before logging, storing, or sending text to an LLM. It also names the alternative for name detection, so the agent has a clear routing rule.

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