mask_text
Replace sensitive data (IDs, phone numbers, emails, names) with opaque tokens before sending text to LLMs. Keep session_id to restore original values later.
Instructions
Pseudonymize sensitive entities in text before sending to a cloud LLM.
Replaces national ID numbers, tax IDs, phone numbers, IBANs, cards and email addresses via regex, and person names and organization names via local Ollama NER — with opaque tokens like [PESEL:1], [PERSON:2], [ORG:1].
Every locale pack runs by default. The response reports active_locales, and disabled_locales plus a locale_warning whenever the server was narrowed with --lang and can therefore miss identifiers from other countries.
Returns the masked text plus a session_id. Store the session_id to restore the original values later using unmask_text.
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": "mask_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to pseudonymize | |
| session_id | No | Optional: reuse an existing session to preserve token numbering across multiple calls | |
| wait_for_ner | No | If true, wait up to 30 s for Ollama to finish loading the model before processing (default: false) | |
| custom_literals | No | Specific strings to always redact (names, IDs, phone numbers) |