Skip to main content
Glama
fairquery-agent-trust-mcp

fairquery-agent-trust-mcp

Official

Redact PII and secrets locally (free)

pii_redact_text
Read-onlyIdempotent

Redacts PII and secrets from up to 50 text inputs locally before sending them to LLMs or third parties, using reversible placeholders, masking, or hashed tokens with an optional placeholder map for restoration.

Instructions

WHAT: Return sanitized copies of texts with every local PII/secret finding replaced (placeholder [EMAIL_1], mask, or salted hash). Placeholders are consistent across documents in one call. Runs 100% on your machine. WHEN: Right before sending user data to an LLM/third party. Use returnPlaceholderMap=true if you need to restore originals in the LLM answer later. WHEN NOT: For a findings report only use pii_scan_text. For names/addresses NER, URLs or PDFs use pii_guard_documents (paid). COST: Free; no token. RETURNS: One "redacted_document" row per text with output_text; meta.placeholder_map only when requested. Errors: INPUT_TOO_LARGE. BEHAVIOR: Same input gives the same output except redactionStyle "hash" (random per-call salt). No network calls; local, milliseconds. Max 50 texts, 200,000 chars each, 500,000 total. PARAMETERS: texts: one element per document, 500,000 chars in total; the same value gets the same placeholder in every document of one call ([EMAIL_1] everywhere), but numbering restarts on each call. redactionStyle: "placeholder" is the only reversible style; "mask" keeps a few characters for human review; "hash" output differs between calls (random salt), so do not compare hashes across calls. returnPlaceholderMap: only has an effect with redactionStyle="placeholder" (ignored for mask/hash); the map in meta.placeholder_map holds the ORIGINAL values, so keep it out of the LLM prompt and restore answers with pii_restore_text (free, local). entityTypes / allowList / entropyScan / defaultPhoneRegion: identical semantics to pii_scan_text (filter after detection, whole-value case-insensitive allow-list). limit/offset page whole documents (one item per text, default 10 per page), not findings. EXAMPLE: {"texts":["Call +1 415 555 0100 or mail jane@acme.com"]} -> output_text "Call [PHONE_1] or mail [EMAIL_1]".

Input Schema

NameRequiredDescriptionDefault
limitNoOptional page size: items to return, integer 1-50 (default 10). Example: 10
textsYesRequired. 1-50 documents (prompt, chat message, log, file content), each <= 200,000 chars, total <= 500,000 chars. Example: ["Mail jane@acme.com, key AKIAIOSFODNN7EXAMPLE"]
offsetNoOptional zero-based number of items to skip, integer 0-1000000 (default 0); pass nextOffset from the previous response, e.g. 100
allowListNoOptional, default [] (nothing exempt). 0-500 exact values (<= 500 chars each) that are never flagged; whole-value, case-insensitive match, not substring. Example: ["support@yourco.com","192.0.2.1"]
entityTypesNoOptional, default omitted = every local detector. 0-40 detector type names (<= 40 chars, case-insensitive), e.g. ["EMAIL","CREDIT_CARD","AWS_ACCESS_KEY"]. Valid values: the "type" field of pii_list_detectors rows with local:true; unknown names match nothing (no error)
entropyScanNoOptional boolean, default false. true also flags unlabeled random-looking tokens of 20-200 chars as HIGH_ENTROPY_STRING (catches unknown key formats; may flag hashes/UUIDs). Example: true
redactionStyleNoOptional, one of "placeholder" | "mask" | "hash", default "placeholder". "placeholder" = [EMAIL_1] (reversible); "mask" = j***@a***.com, **** **** **** 1111; "hash" = [EMAIL:3f2a9c0d1b7e] (salted sha256 prefix, random per-call salt). Example: "mask"placeholder
defaultPhoneRegionNoOptional, default "US". ISO 3166-1 alpha-2 code (2 letters, pattern ^[A-Za-z]{2}$, case-insensitive) used only for phone numbers written without a +country prefix. Examples: "US", "DE", "GB"US
returnPlaceholderMapNoOptional boolean, default false. true (placeholder style only) adds meta.placeholder_map {"[EMAIL_1]":"jane@acme.com"} containing the ORIGINAL sensitive values. Example: true

Output Schema

NameRequiredDescriptionDefault
metaNoTool-specific context (summary counts, cost notes, ...)
countYesNumber of items in this page
itemsYesResult rows for this page
totalYesTotal items before paging
offsetYesOffset of the first item in this page
hasMoreYesTrue if more items exist after this page
nextOffsetYesOffset to pass for the next page, or null

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • changedInput schema / properties / allowList / description
      Previous value: -"Exact values never flagged (case-insensitive), e.g. [\"support@yourco.com\"]. Default []"New value: +"Optional, default [] (nothing exempt). 0-500 exact values (<= 500 chars each) that are never flagged; whole-value, case-insensitive match, not substring. Example: [\"support@yourco.com\",\"192.0.2.1\"]"
    • changedInput schema / properties / defaultPhoneRegion / description
      Previous value: -"ISO 3166-1 alpha-2 region for phones without +prefix, e.g. \"US\" (default), \"DE\", \"GB\""New value: +"Optional, default \"US\". ISO 3166-1 alpha-2 code (2 letters, pattern ^[A-Za-z]{2}$, case-insensitive) used only for phone numbers written without a +country prefix. Examples: \"US\", \"DE\", \"GB\""
    • changedInput schema / properties / entityTypes / description
      Previous value: -"Only report these types, e.g. [\"EMAIL\",\"CREDIT_CARD\",\"AWS_ACCESS_KEY\"]. Omit = all local detectors. Valid names: pii_list_detectors"New value: +"Optional, default omitted = every local detector. 0-40 detector type names (<= 40 chars, case-insensitive), e.g. [\"EMAIL\",\"CREDIT_CARD\",\"AWS_ACCESS_KEY\"]. Valid values: the \"type\" field of pii_list_detectors rows with local:true; unknown names match nothing (no error)"
    • changedInput schema / properties / entropyScan / description
      Previous value: -"Also flag unlabeled random-looking 20-200 char tokens as HIGH_ENTROPY_STRING (default false; may flag hashes/IDs)"New value: +"Optional boolean, default false. true also flags unlabeled random-looking tokens of 20-200 chars as HIGH_ENTROPY_STRING (catches unknown key formats; may flag hashes/UUIDs). Example: true"
    • changedInput schema / properties / limit / description
      Previous value: -"Page size: items to return, integer 1-50 (default 10)"New value: +"Optional page size: items to return, integer 1-50 (default 10). Example: 10"
    • changedInput schema / properties / offset / description
      Previous value: -"Items to skip for paging, integer >= 0 (default 0); pass nextOffset from the previous response"New value: +"Optional zero-based number of items to skip, integer 0-1000000 (default 0); pass nextOffset from the previous response, e.g. 100"
    • changedInput schema / properties / redactionStyle / description
      Previous value: -"\"placeholder\" (default) = [EMAIL_1]; \"mask\" = j***@a***.com; \"hash\" = [EMAIL:3f2a9c0d1b7e] (random per-call salt)"New value: +"Optional, one of \"placeholder\" | \"mask\" | \"hash\", default \"placeholder\". \"placeholder\" = [EMAIL_1] (reversible); \"mask\" = j***@a***.com, **** **** **** 1111; \"hash\" = [EMAIL:3f2a9c0d1b7e] (salted sha256 prefix, random per-call salt). Example: \"mask\""
    • changedInput schema / properties / returnPlaceholderMap / description
      Previous value: -"Default false. If true (placeholder style), meta.placeholder_map maps \"[EMAIL_1]\" -> original value"New value: +"Optional boolean, default false. true (placeholder style only) adds meta.placeholder_map {\"[EMAIL_1]\":\"jane@acme.com\"} containing the ORIGINAL sensitive values. Example: true"
  2. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/non-destructive/local, yet the description adds real operational facts: no network calls, millisecond latency, deterministic output except the hash style whose salt is random per call, the INPUT_TOO_LARGE error, and the 50-doc / 200k-per-doc / 500k-total limits. It also warns that the placeholder map contains originals and must be kept out of the LLM prompt, which is exactly the kind of risk an annotation cannot express.

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

Conciseness4/5

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

The labeled sections (WHAT/WHEN/WHEN NOT/COST/RETURNS/BEHAVIOR/PARAMETERS/EXAMPLE) make it skimmable and front-loaded with the decision-relevant parts. It is long and mildly repetitive — the size limits appear in both BEHAVIOR and PARAMETERS, and 'free/local' is restated from the title — but nothing is filler.

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?

With 9 parameters, a mutation-adjacent redaction result, and an output schema, this is the level of detail needed: limits, error code, determinism guarantees, restoration path via pii_restore_text, and a concrete input-to-output example. An agent has everything required to call it correctly and to interpret the response.

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?

Schema coverage is 100% (baseline 3), but the PARAMETERS block adds semantics the schema does not: placeholder consistency across documents in one call with numbering restarting per call, 'hash' being non-comparable across calls, returnPlaceholderMap being silently ignored for mask/hash, and limit/offset paging whole documents rather than findings. These are non-obvious interaction rules between parameters, not restatements.

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 WHAT line states a specific verb and resource ('Return sanitized copies of texts with every local PII/secret finding replaced') plus the three replacement styles, and the WHEN NOT line names the two siblings it is not (pii_scan_text for reports, pii_guard_documents for NER/URLs/PDFs). An agent can distinguish the three text-PII tools without opening a schema.

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?

WHEN gives the trigger ('right before sending user data to an LLM/third party') and adds a conditional hint for returnPlaceholderMap when restoration is needed. WHEN NOT explicitly routes findings-only work to pii_scan_text and NER/URL/PDF cases to pii_guard_documents, so both the use case and the exclusions are covered.

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