Skip to main content
Glama

anonymize_text

Remove personally identifiable information from text by replacing patient IDs, GPS coordinates, national IDs, emails, and phone numbers with anonymized placeholders. Returns anonymized text and replacement map.

Instructions

Scrub PII from text and return anonymized version + replacement map.

Replaces:
  - Patient/case IDs        → [PARTICIPANT_001]
  - GPS coordinates         → [GPS_001]
  - Belgian national IDs    → [NID_001]
  - Email addresses         → [EMAIL_001]
  - Phone numbers           → [PHONE_001]
  - Name-like tokens (opt.) → [NAME_001]

Args:
    content:        Text to anonymize.
    mode:           'full' — replace; 'preview' — mark without replacing.
    replace_names:  Also replace CAPITALIZED name-like tokens (heuristic).

Returns JSON with keys 'anonymized' (str) and 'replacements' (dict).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
modeNofull
replace_namesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description fully covers behavioral traits: it lists the patterns replaced, explains the effect of modes and the 'replace_names' option, and specifies the return format (JSON with 'anonymized' and 'replacements' keys).

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?

The description is well-structured with a brief intro, bulleted list of replacements, and clear parameter explanations. Every sentence adds value, and the format is easy to parse.

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?

Despite having only 3 parameters and no annotations, the description covers all necessary context: input, configuration, return format, and behavioral details. The presence of an output schema is acknowledged but the description already specifies the return keys.

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 description adds significant meaning beyond the input schema: it explains that 'content' is the text to anonymize, 'mode' accepts 'full' or 'preview' (enum values not in schema), and 'replace_names' is a boolean flag for heuristic name replacement. This compensates for the 0% schema description coverage.

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 clearly states the tool scrubs PII from text and returns an anonymized version with a replacement map. It lists specific replacements (patient IDs, GPS, etc.) and distinguishes its function from siblings like 'diff_anonymization' by focusing on anonymization rather than comparison.

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

Usage Guidelines3/5

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

The description explains what the tool does and its modes ('full' vs 'preview'), but it does not explicitly state when to use this tool over alternatives or provide usage constraints like required permissions or privacy considerations.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SVerITG/Metis_PH'

If you have feedback or need assistance with the MCP directory API, please join our Discord server