Skip to main content
Glama

Redact PII

promptguard_redact
Read-only

Redact PII from text. Returns the text with each entity replaced by a labeled placeholder, e.g. [EMAIL_REDACTED], [PHONE_REDACTED], [SSN_REDACTED], the PII types found, and skipped: the matches deliberately left in the text. Never returns the original text. Each call counts as one Request on your PromptGuard plan. Without pii_types it redacts what the Project's policy redacts; a default Project redacts emails, phone numbers, SSNs, payment cards, bank and national identifiers, IP addresses and API keys. Pass pii_types to redact only the types you name. An email at a domain reserved for documentation and testing (example.com, .test, .invalid, localhost) is never redacted, since it cannot be a person's address: it comes back in skipped with the reason reserved_domain, so test with a real-looking domain. When to use: Before including user data in LLM prompts, when processing customer messages, or when building RAG pipelines that ingest documents containing personal information.

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": "promptguard_redact"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text content to redact PII from
pii_typesNoPII types to redact, the REST API's vocabulary: detector entity names ('email', 'ssn', 'credit_card', 'phone_us'), the family aliases 'phone', 'ip_address' and 'passport', and 'api_key'. Omit to redact what the Project's policy redacts. An unrecognized name is refused with the code 'unknown_pii_type' rather than ignored.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / pii_types
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "PII types to redact, the REST API's vocabulary: detector entity names ('email', 'ssn', 'credit_card', 'phone_us'), the family aliases 'phone', 'ip_address' and 'passport', and 'api_key'. Omit to redact what the Project's policy redacts. An unrecognized name is refused with the code 'unknown_pii_type' rather than ignored."
      +}
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "kind": {
      -        "const": "redact"
      -      },
      -      "piiCount": {
      -        "type": "integer"
      -      },
      -      "piiFound": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "redacted": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "redacted",
      -      "piiFound",
      -      "piiCount"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "code": {
      -        "type": "string"
      -      },
      -      "error": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "error"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "error"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "kind": {
      +        "const": "redact"
      +      },
      +      "piiCount": {
      +        "type": "integer"
      +      },
      +      "piiFound": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "redacted": {
      +        "type": "string"
      +      },
      +      "skipped": {
      +        "items": {
      +          "description": "One match a detector found and deliberately did not act on.",
      +          "properties": {
      +            "reason": {
      +              "description": "Why it was left in the text, a stable code. `reserved_domain`: an email at a domain reserved for documentation and testing by RFC 2606 and RFC 6761 (`example.com`, `example.net`, `example.org`, and any domain ending `.example`, `.test`, `.invalid` or `.localhost`), which cannot be a person's address. Test redaction with an address at a real-looking domain. A client that does not recognise a code must still treat the match as left in the text.",
      +              "examples": [
      +                "reserved_domain"
      +              ],
      +              "title": "Reason",
      +              "type": "string"
      +            },
      +            "type": {
      +              "description": "The detector type of the match, e.g. `email`.",
      +              "title": "Type",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "type",
      +            "reason"
      +          ],
      +          "title": "SkippedMatch",
      +          "type": "object"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "redacted",
      +      "piiFound",
      +      "piiCount",
      +      "skipped"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "code": {
      +        "type": "string"
      +      },
      +      "error": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "error"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "kind": {
      -        "const": "redact"
      -      },
      -      "piiCount": {
      -        "type": "integer"
      -      },
      -      "piiFound": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "redacted": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "redacted",
      -      "piiFound",
      -      "piiCount"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "error": {
      -        "type": [
      -          "string",
      -          "object"
      -        ]
      -      },
      -      "kind": {
      -        "const": "error"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "error"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "kind": {
      +        "const": "redact"
      +      },
      +      "piiCount": {
      +        "type": "integer"
      +      },
      +      "piiFound": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "redacted": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "redacted",
      +      "piiFound",
      +      "piiCount"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "code": {
      +        "type": "string"
      +      },
      +      "error": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "error"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With annotations already declaring readOnlyHint=true, openWorldHint=false and destructiveHint=false, the description still adds substantial behavior: output is placeholders only and the original text is never returned, each call bills as one Request, and reserved-domain emails are deliberately left in `skipped` with a named reason. That billing and skip-disclosure detail is exactly what annotations cannot convey.

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 purpose and return shape, then parameters, then use cases — a sensible order. A little space is spent restating schema content (the `pii_types` default rule, the unrecognized-name behavior) and explaining return values despite an output schema existing.

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 two-parameter transformation tool, everything an agent needs is present: what it does, what comes back, what the default redaction set is, how billing works, and one important edge case. Nothing material is deferred to guesswork.

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?

Schema coverage is already 100%, yet the description still adds the concrete default policy list (emails, phone numbers, SSNs, payment cards, bank and national identifiers, IP addresses, API keys) and the semantics of omitting versus supplying `pii_types`. It also explains the reserved-domain exception, which is parameter-relevant behavior no schema field captures.

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 and resource ('Redact PII from text') and immediately characterizes the return shape: text with labeled placeholders, the PII types found, and a `skipped` list. This is clearly distinguishable from the sibling scan tools, which analyze rather than transform.

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?

An explicit 'When to use' block gives three concrete scenarios (LLM prompts, customer messages, RAG ingestion), and the `pii_types` paragraph explains the default-vs-narrow choice. It stops short of naming a sibling alternative such as promptguard_scan_text or stating when to prefer scanning over redacting.

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.