{"openapi":"3.1.0","info":{"title":"pii-redact","version":"0.1.0","description":"Detect and redact PII in text or JSON. Recognizers are pure pattern/checksum matching (regex + Luhn/mod-97/SSN-area validation) — no LLM calls, no external services. Person names and dates of birth are matched only via nearby context (e.g. 'Mr. Smith', 'DOB: ...'), not general NER, to keep false positives low.","x-guidance":"Call `redact` with `input`: a string, a JSON object, or an array (total payload ≤1MB) to scan for PII. Optionally set `options.entities` (subset of email, phone, ssn, credit_card, iban, ip, us_passport, us_driver_license, dob, us_address, person_name — defaults to all except us_driver_license, which is opt-in only due to a high false-positive rate), `options.mode` (\"mask\" to replace with asterisks, \"label\" to replace with a type tag (default), or \"remove\" to delete the match), and `options.locale` (currently only \"us\"). Returns `redacted` (the input with matches transformed per `mode`), `findings` (span, type, field path, and confidence per match), and `counts` (match count per entity type). Deterministic and side-effect-free: safe to retry on the same input.","contact":{"email":"jeff@fosterinstruments.com"}},"servers":[{"url":"https://pii-redact.x402supply.com"}],"paths":{"/mcp":{"post":{"operationId":"pii-redact_call","summary":"Call pii-redact via MCP tools/call","tags":["pii-redact"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","number"]},"method":{"const":"tools/call"},"params":{"type":"object","required":["name","arguments"],"properties":{"name":{"const":"redact"},"arguments":{"type":"object","properties":{"input":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"options":{"type":"object","properties":{"entities":{"type":"array","items":{"type":"string","enum":["email","phone","ssn","credit_card","iban","ip","us_passport","us_driver_license","dob","us_address","person_name"]},"minItems":1},"mode":{"type":"string","enum":["mask","label","remove"]},"locale":{"type":"string","enum":["us"]}},"additionalProperties":false}},"required":["input"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","description":"JSON-RPC 2.0 response envelope. `result.content[0].text` is a JSON-encoded string matching the schema in `x-mcp-result-schema`.","properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","number"]},"result":{"type":"object","properties":{"content":{"type":"array","items":{"type":"object","properties":{"type":{"const":"text"},"text":{"type":"string"}}}}}}},"x-mcp-result-schema":{"type":"object","required":["redacted","findings","counts"],"properties":{"redacted":{"description":"Input with matches transformed per `options.mode`; same shape as `input`."},"findings":{"type":"array","items":{"type":"object","required":["type","span_start","span_end","confidence"],"properties":{"type":{"type":"string","enum":["email","phone","ssn","credit_card","iban","ip","us_passport","us_driver_license","dob","us_address","person_name"]},"span_start":{"type":"integer"},"span_end":{"type":"integer"},"path":{"type":"string","description":"Dot/bracket path to the field, absent for plain-string input"},"confidence":{"type":"number","minimum":0,"maximum":1}}}},"counts":{"type":"object","additionalProperties":{"type":"integer"},"description":"Match count per entity type"}}}}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"type":"object","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array"}}}}}}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{}}]}}},"/tools/redact":{"post":{"operationId":"pii-redact_redact_http","summary":"Detect and redact PII in text or JSON. Recognizers are pure pattern/checksum matching (regex + Luhn/mod-97/SSN-area validation) — no LLM calls, no external services. Person names and dates of birth are matched only via nearby context (e.g. 'Mr. Smith', 'DOB: ...'), not general NER, to keep false positives low.","tags":["pii-redact"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"input":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"options":{"type":"object","properties":{"entities":{"type":"array","items":{"type":"string","enum":["email","phone","ssn","credit_card","iban","ip","us_passport","us_driver_license","dob","us_address","person_name"]},"minItems":1},"mode":{"type":"string","enum":["mask","label","remove"]},"locale":{"type":"string","enum":["us"]}},"additionalProperties":false}},"required":["input"],"additionalProperties":false},"example":{"input":"Contact Jane Doe at jane.doe@example.com or 513-555-0142. SSN 123-45-6789.","options":{"mode":"label"}}}}},"responses":{"200":{"description":"Tool result (plain JSON, not MCP-wrapped)","content":{"application/json":{"schema":{"type":"object","required":["redacted","findings","counts"],"properties":{"redacted":{"description":"Input with matches transformed per `options.mode`; same shape as `input`."},"findings":{"type":"array","items":{"type":"object","required":["type","span_start","span_end","confidence"],"properties":{"type":{"type":"string","enum":["email","phone","ssn","credit_card","iban","ip","us_passport","us_driver_license","dob","us_address","person_name"]},"span_start":{"type":"integer"},"span_end":{"type":"integer"},"path":{"type":"string","description":"Dot/bracket path to the field, absent for plain-string input"},"confidence":{"type":"number","minimum":0,"maximum":1}}}},"counts":{"type":"object","additionalProperties":{"type":"integer"},"description":"Match count per entity type"}}},"example":{"redacted":"Contact Jane Doe at [EMAIL_1] or [PHONE_1]. SSN [SSN_1].","findings":[{"type":"email","span_start":20,"span_end":40,"confidence":0.95},{"type":"phone","span_start":44,"span_end":56,"confidence":0.85},{"type":"ssn","span_start":62,"span_end":73,"confidence":0.9}],"counts":{"email":1,"phone":1,"ssn":1}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"type":"object","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array"}}}}}}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{}}]}}}}}