I built an experiment that extracts document details, masks selected personal information, checks the results, and sends exceptions for human review. It is not a compliance certification.
I built five document-processing tools for extraction, masking personal information, checking required fields and rules, human review, and cost reporting. The tools work with Claude. This personal experiment does not establish compliance.
I explored how to separate automated checks from decisions that need a person.
I separated the process into tools that extract, mask, check, route, and total costs. Claude chooses the tools. Exceptions go to a person for review.
doc_extract without touching the four downstream tools.
Four runs: three clean documents, plus one claim with deliberately broken amounts and a missing required field. The traces below are real outputs from the pipeline runner — same JSON the MCP tools produce when run end-to-end.
doc_extract doesn't call Claude — it's a tool that returns a structured work order for Claude to carry out. Production with direct API access plugs in here without touching any downstream stage.
request { "doc_text": "NORTHSTAR MUTUAL — AUTO CLAIM SUBMISSION\nClaim ID: NSM-2026-0451829\n...", "doc_type": "claim" } response { "task": "Extract structured data from this claim document. Conform exactly to the schema. Return JSON only.", "doc_type": "claim", "schema": { /* full JSON Schema for AutoClaim — types, requireds, patterns, formats */ }, "extraction_rules": [ "Output JSON only, conforming exactly to the provided schema. No commentary, no markdown fences.", "Use ISO 8601 for all dates (YYYY-MM-DD) and date-times (YYYY-MM-DDTHH:mm:ssZ or with offset).", "Currency values: strip $ and commas, return as numbers.", "Missing fields → null. Do not invent values.", "policyholder.address.state should be the two-letter USPS code.", "vehicle.year is an integer, not a string.", /* 7 more rules */ ], "output_format": "Plain JSON, valid against the schema. No prose, no fences, no comments.", "on_completion": "Pass the extracted JSON to pii_mask with doc_type='claim'.", "estimate": { "stage": "extract", "input_tokens": 1955 } }