Skip to main content
Glama
privacyscrubber-mcp

privacyscrubber-mcp

sanitize_text

Read-onlyIdempotent

Scrub PII, secrets, and credentials from text, code, or logs locally before LLM processing, replacing sensitive values with safe placeholders.

Instructions

STEP 1: Call this first. You MUST NOT process raw user data before calling this. Locally scrubs PII, secrets, and credentials (like API keys, passwords, emails, phones, names) from code, logs, or text. Replaces them with safe placeholders (e.g., [EMAIL_1], [API_KEY_1]). Keep your data secure before passing it to any LLM. Supports General and all 30 specialized industry profiles in RAM session map. (For in-code backend services or RAG vector pipelines outside of MCP, use '@privacyscrubber/sdk': npm i @privacyscrubber/sdk)

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

Input Schema

NameRequiredDescriptionDefault
textYesThe raw text, code, or logs to sanitize.
sectorNoOptional alias for 'profile'. The industry sector or compliance vertical to apply (e.g. 'medical', 'finance', 'legal', 'dev', 'hr', 'accounting', 'security', 'compliance', 'underwriting', 'telecom').
compactNoOptional. When true, returns a compact 1-line audit summary saving token overhead in AI IDEs (Cursor, Claude Desktop).
profileNoThe detection profile to use. Available: 'General' (Free, 15,000 chars), or 30 specialized industry profiles (5,000 chars Free trial quota; unlimited on PRO/TEAMS/SDK): 'Dev' (Engineering/Code), 'Medical', 'Pharma', 'Biotech', 'Telecom', 'Legal', 'Compliance', 'CCPA', 'Finance', 'Bizops', 'Sales', 'WealthMgmt', 'Insurance', 'Accounting', 'Underwriting', 'Automotive', 'Energy', 'Hospitality', 'HR', 'Security', 'Marketing', 'Support', 'RealEstate', 'Agents', 'Academic', 'Creative', 'Tech', 'Personal', 'Engineering'. Defaults to 'General'.
session_idNoOptional session ID for multi-agent isolation (e.g. Cursor task vs Claude Desktop). Defaults to 'default'.
ignore_listNoOptional list of plaintext values to skip during detection (false positives from previous scrubs). These values will also be persisted in the session ignore list for all future calls.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.0.3
    • addedInput schema / properties / compact
      Added value: +{
      +  "description": "Optional. When true, returns a compact 1-line audit summary saving token overhead in AI IDEs (Cursor, Claude Desktop).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / ignore_list
      Added value: +{
      +  "description": "Optional list of plaintext values to skip during detection (false positives from previous scrubs). These values will also be persisted in the session ignore list for all future calls.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / profile / description
      Previous value: -"The detection profile to use. Available: 'General' (Free), or PRO profiles: 'Dev' (Engineering/Code), 'Medical', 'Pharma', 'Legal', 'Compliance', 'CCPA', 'Finance', 'Bizops', 'Sales', 'WealthMgmt', 'Insurance', 'Accounting', 'HR', 'Security', 'Marketing', 'Support', 'RealEstate', 'Agents', 'Academic', 'Creative', 'Tech', 'Personal'. Defaults to 'General'."New value: +"The detection profile to use. Available: 'General' (Free, 15,000 chars), or 30 specialized industry profiles (5,000 chars Free trial quota; unlimited on PRO/TEAMS/SDK): 'Dev' (Engineering/Code), 'Medical', 'Pharma', 'Biotech', 'Telecom', 'Legal', 'Compliance', 'CCPA', 'Finance', 'Bizops', 'Sales', 'WealthMgmt', 'Insurance', 'Accounting', 'Underwriting', 'Automotive', 'Energy', 'Hospitality', 'HR', 'Security', 'Marketing', 'Support', 'RealEstate', 'Agents', 'Academic', 'Creative', 'Tech', 'Personal', 'Engineering'. Defaults to 'General'."
    • addedInput schema / properties / sector
      Added value: +{
      +  "description": "Optional alias for 'profile'. The industry sector or compliance vertical to apply (e.g. 'medical', 'finance', 'legal', 'dev', 'hr', 'accounting', 'security', 'compliance', 'underwriting', 'telecom').",
      +  "type": "string"
      +}
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Optional session ID for multi-agent isolation (e.g. Cursor task vs Claude Desktop). Defaults to 'default'.",
      +  "type": "string"
      +}
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "text": {
      -      "description": "The sanitized text output.",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "text"
      -  ],
      -  "type": "object"
      -}New value: +null
  2. Changed1 schema field changedv1.0.2
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "text": {
      +      "description": "The sanitized text output.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "text"
      +  ],
      +  "type": "object"
      +}
  3. First observedv1.0.1

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, and the description adds genuinely new behavior: local in-RAM processing, a session map for isolation, placeholder naming convention, ignore_list persistence across calls, and per-profile character quotas (15,000 General / 5,000 trial). The 'Keep your data secure' line is promotional rather than informative, and the return payload shape is not described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The ordering instruction is usefully front-loaded, but the text carries marketing weight ('You MUST NOT process raw user data', 'Keep your data secure') and an npm install pitch appended in parentheses that dilutes scannability. Some repetition of the profile/quota information already present in the schema adds length without adding meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter, no-output-schema tool, the description covers purpose, sequencing, placeholder output, session isolation, and quotas well enough to call it correctly. The only real gap is what exactly comes back (sanitized text plus an audit summary, hinted at only via the 'compact' parameter reference).

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 description coverage is 100%, so all six parameters are already documented in schema; baseline is 3. The description restates profile coverage ('General and all 30 specialized industry profiles') and RAM session scoping, but adds no format, defaulting, or interaction detail beyond what the schema fields already say.

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 ('Locally scrubs PII, secrets, and credentials... from code, logs, or text') and names the transformation ('Replaces them with safe placeholders (e.g., [EMAIL_1], [API_KEY_1])'). That distinguishes it from file-oriented siblings like sanitize_file, redact_file, and reveal_text at a glance.

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?

Gives clear when-to-use direction: 'STEP 1: Call this first' and 'before passing it to any LLM', plus an exclusion that routes non-MCP work to the SDK. It does not explicitly say when to prefer sanitize_file, redact_file, or guard_rag_chunk over this tool, so sibling-level routing is left implicit.

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