Skip to main content
Glama
privacyscrubber-mcp

privacyscrubber-mcp

sanitize_text

Idempotent

Scrubs PII, secrets, and credentials from code, logs, or text and replaces them with safe placeholders before passing data to an LLM.

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.
verbose_receiptNoOptional. When true, returns a detailed multi-line audit receipt breakdown.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.5.2
    • addedInput schema / properties / verbose_receipt
      Added value: +{
      +  "description": "Optional. When true, returns a detailed multi-line audit receipt breakdown.",
      +  "type": "boolean"
      +}
  2. 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
  3. 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"
      +}
  4. First observedv1.0.1

TDQS

A4.2/5.0
Behavior4/5

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

Adds substantial context beyond the annotations: processing is local/in-RAM, output is placeholder-substituted, sessions isolate multi-agent work, and per-profile character quotas (15,000 General Free vs 5,000 specialized Free trial) are disclosed. It does not say what happens when a quota is exceeded or whether a scrub is recoverable via the sibling reveal_text tool, so the failure path remains undisclosed.

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 core purpose is front-loaded, but the text is padded with promotional framing ('Keep your data secure before passing it to any LLM'), an npm install command, and all-caps imperatives ('You MUST NOT...'). Several sentences repeat the profile/quota facts already present in the schema, diluting the operative guidance.

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?

With seven parameters and no output schema, the description does the necessary work of explaining the return shape (placeholders, compact audit line, verbose receipt) and the local-processing model. Remaining gaps — quota-exceeded behavior and how placeholders map back to originals — are secondary for a first-step sanitizer.

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 every parameter including sector, compact, session_id, ignore_list and verbose_receipt is already documented in the schema. The description adds profile/quota framing and the placeholder output convention, but never mentions the 'sector' alias as a profile synonym, so it does not add much meaning over the structured data.

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 concrete output form ('Replaces them with safe placeholders (e.g., [EMAIL_1], [API_KEY_1])'). The 'STEP 1: Call this first' framing positions it against the sibling guard_/reveal_ tools as the entry point of the pipeline.

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?

Explicit about when to invoke ('before calling this', 'before passing it to any LLM') and names the alternative path for out-of-scope cases (in-code backend services or RAG pipelines should use the '@privacyscrubber/sdk' instead of this MCP tool). The boundary between MCP usage and SDK usage is spelled out rather than inferred.

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