{"at":"2026-11-23T05:04:44.949Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T05:04:45.380Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T05:04:45.481Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T05:04:45.864Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{"listChanged":true}},"protocolVersion":"2025-11-25","serverInfo":{"name":"redacta","version":"2.1.1"}}}}
{"at":"2026-11-23T05:04:45.864Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T05:04:45.864Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T05:04:45.867Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"annotations":{"openWorldHint":false,"readOnlyHint":false,"title":"Protect text (mapping stays server-side)"},"description":"Redact patient identifiers and PII, replacing each distinct value with a labelled token ([NHS_NUMBER_1], [PATIENT_NAME_1], ...). The reversal mapping is kept privately inside the Redacta server and is NEVER included in this response — you receive only the protected text, an opaque session_id for later controlled restoration, a count of what was replaced, and a self-check of possible leftovers. Sessions expire automatically.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"categories":{"description":"Which pattern sets to apply. Defaults to clinical + general. 'clinical' = NHS/NI/DOB/MRN/postcode/SSN/ZIP/email/phone/names; 'general' = URLs, IPs, payment cards, IBANs, account numbers, vehicle regs; 'safeharbor' = strictest, HIPAA Safe Harbor — implies clinical + general and also removes ALL dates (not just DOB), ages, fax, licence, device-serial, VIN and health-plan numbers.","items":{"enum":["clinical","general","safeharbor"],"type":"string"},"type":"array"},"text":{"description":"The text to protect.","type":"string"}},"required":["text"],"type":"object"},"name":"protect","title":"Protect text (mapping stays server-side)"},{"annotations":{"openWorldHint":false,"readOnlyHint":false,"title":"Restore identifiers into a local file"},"description":"Restore original identifiers into text produced from a protected session, writing the result to a file inside the server's configured release directory (REDACTA_RELEASE_DIR). Returns only a receipt — file path, size, and counts — so restored data never enters the model context. This is the privacy-preserving way to complete the round trip.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"session_id":{"description":"The session_id returned by protect.","type":"string"},"text":{"description":"Text containing Redacta tokens to restore.","type":"string"}},"required":["text","session_id"],"type":"object"},"name":"release_to_file","title":"Restore identifiers into a local file"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Check output for leaked identifiers"},"description":"Scan generated text for verbatim reappearance of the original values held in a protected session (tolerant of spacing, dashes and case for identifier-like values) and re-tokenise anything found. Returns which token categories leaked — never the raw values — plus the sanitised text and a general self-check. Scope is verbatim reappearance only: paraphrases and inferred identities are not detected.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"session_id":{"description":"The session_id returned by protect.","type":"string"},"text":{"description":"Model output to inspect.","type":"string"}},"required":["text","session_id"],"type":"object"},"name":"check_output","title":"Check output for leaked identifiers"},{"annotations":{"openWorldHint":false,"readOnlyHint":false,"title":"Discard a protection session"},"description":"Delete a session's private mapping immediately instead of waiting for expiry. Idempotent. After this, no restoration is possible for that session.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"session_id":{"description":"The session_id to discard.","type":"string"}},"required":["session_id"],"type":"object"},"name":"discard_session","title":"Discard a protection session"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Redact / pseudonymise text (legacy — exposes token map)"},"description":"LEGACY: like protect, but returns the token_map (token -> original value) in the response, which places the reversal key in the client and potentially the model context. Kept for backward compatibility and client-managed workflows. Prefer protect, which keeps the mapping server-side.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"categories":{"description":"Which pattern sets to apply. Defaults to clinical + general. 'clinical' = NHS/NI/DOB/MRN/postcode/SSN/ZIP/email/phone/names; 'general' = URLs, IPs, payment cards, IBANs, account numbers, vehicle regs; 'safeharbor' = strictest, HIPAA Safe Harbor — implies clinical + general and also removes ALL dates (not just DOB), ages, fax, licence, device-serial, VIN and health-plan numbers.","items":{"enum":["clinical","general","safeharbor"],"type":"string"},"type":"array"},"text":{"description":"The text to redact.","type":"string"}},"required":["text"],"type":"object"},"name":"redact","title":"Redact / pseudonymise text (legacy — exposes token map)"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Re-identify from a client-held token map (legacy)"},"description":"LEGACY: reverse a redaction using a token map held by the client (from the legacy redact tool). Restored personal data will appear in this tool result. For session-based restoration that keeps mappings server-side, use protect + release_to_file.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"text":{"description":"Text containing Redacta tokens to restore.","type":"string"},"token_map":{"additionalProperties":{"type":"string"},"description":"Token map, e.g. {\"[NHS_NUMBER_1]\": \"943 476 5919\"}.","type":"object"}},"required":["text","token_map"],"type":"object"},"name":"reinstate","title":"Re-identify from a client-held token map (legacy)"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Self-check for residual identifiers"},"description":"Scan already-redacted text for anything that still looks like an identifier (long numbers, emails, postcodes, URLs). A second pair of eyes, not a guarantee. Returns a list of possible leftovers to review.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"text":{"description":"Redacted text to re-scan.","type":"string"}},"required":["text"],"type":"object"},"name":"self_check","title":"Self-check for residual identifiers"}]}}}
