Skip to main content
Glama

Redact / pseudonymise text (legacy — exposes token map)

redact
Read-only

Replaces sensitive identifiers in text with labelled tokens and returns the token map so clients can restore original values.

Instructions

LEGACY: like protect, but returns the token_map (token -> original value) in the response, which places the reversal key in the client and potentially the model context. Kept for backward compatibility and client-managed workflows. Prefer protect, which keeps the mapping server-side.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe text to redact.
categoriesNoWhich pattern sets to apply. Defaults to clinical + general. 'clinical' = NHS/NI/DOB/MRN/postcode/SSN/ZIP/email/phone/names; 'general' = URLs, IPs, payment cards, IBANs, account numbers, vehicle regs; 'safeharbor' = strictest, HIPAA Safe Harbor — implies clinical + general and also removes ALL dates (not just DOB), ages, fax, licence, device-serial, VIN and health-plan numbers.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and openWorldHint, and the description adds non-obvious risk: the token_map exposes the reversal key in the client and potentially the model context. It also discloses that protect keeps the mapping server-side, a key behavioral difference beyond annotations.

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?

Three short sentences with the legacy warning and key differentiator front-loaded. Every sentence adds value and none repeat what the schema already states.

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?

Even though there is no output schema, the description covers the essential return behavior (token_map), the exposure risk, and the recommended alternative. With full schema coverage and annotations, nothing an agent needs to invoke or avoid this tool is 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 coverage is 100%; both text and categories have descriptive entries in the input schema. The description does not add parameter-level detail beyond mentioning the response token_map, so the baseline of 3 is appropriate.

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 names a specific operation (redact/pseudonymise), flags it as legacy, and differentiates it from protect by the token_map return. An agent can tell redact apart from its main sibling without opening the schema.

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 'Prefer protect' and names the only condition for choosing redact: backward compatibility or client-managed workflows. This is a clear when/when-not directive with the alternative identified.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.