De-identify Clinical Text (PHI Removal)
anonymizeMask Protected Health Information (PHI) in clinical text to ensure HIPAA compliance by replacing sensitive data like names, dates, and contact details with type labels.
Instructions
Detect and mask Protected Health Information (PHI) in clinical text. Replaces names, dates, SSNs, phone numbers, emails, addresses, MRNs, and ages with type labels like [NAME], [DATE], [SSN]. HIPAA-compliant de-identification.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Clinical text containing PHI to de-identify |
Implementation Reference
- src/tools.ts:205-232 (registration)The anonymize tool registration and handler implementation. It uses client.anonymize for the logic and formats the response using formatAnonymizeResponse.
server.registerTool( "anonymize", { title: "De-identify Clinical Text (PHI Removal)", description: "Detect and mask Protected Health Information (PHI) in clinical text. " + "Replaces names, dates, SSNs, phone numbers, emails, addresses, MRNs, and ages " + "with type labels like [NAME], [DATE], [SSN]. HIPAA-compliant de-identification.", inputSchema: { text: z .string() .min(1) .describe("Clinical text containing PHI to de-identify"), }, annotations: { readOnlyHint: true, destructiveHint: false, }, }, async (args) => { try { const result = await client.anonymize(args.text); return ok(formatAnonymizeResponse(result)); } catch (error) { return fail(error); } } );