get_compliance_report
Generate compliance reports by aggregating signed receipts for frameworks like HIPAA, SOX, NIST, SOC2, CMMC, or ISO27001 to meet auditing requirements.
Instructions
Generate a compliance report mapped to a specific framework. Aggregates all receipts tagged with the specified framework.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| framework | Yes | Compliance framework (HIPAA, SOX, NIST, SOC2, CMMC, ISO27001) |
Implementation Reference
- src/server.ts:262-307 (handler)The handler implementation for the 'get_compliance_report' tool, which filters receipts by compliance framework and constructs a report summary.
case "get_compliance_report": { const framework = String(args?.framework ?? "").toUpperCase(); const matching = ledger.filter((r) => r.dct.compliance_tags.some((t) => t.toUpperCase().includes(framework), ), ); const report = { framework, generated_at: new Date().toISOString(), total_decisions: matching.length, allow_count: matching.filter((r) => r.decision === "ALLOW").length, deny_count: matching.filter((r) => r.decision === "DENY").length, avg_risk_score: matching.length > 0 ? Math.round( (matching.reduce((s, r) => s + r.dct.risk_score, 0) / matching.length) * 100, ) / 100 : 0, receipts: matching.map((r) => ({ id: r.id, action: r.action, decision: r.decision, risk_score: r.dct.risk_score, timestamp: r.timestamp_iso, tags: r.dct.compliance_tags, signature: r.signature_b64.slice(0, 16) + "...", })), auditor_note: `All ${matching.length} decisions in this report are Ed25519-signed ` + `and SHA-256-hashed. Each receipt is independently verifiable. ` + `No Receipt. No Trust.`, }; return { content: [ { type: "text", text: JSON.stringify(report, null, 2), }, ], }; } - src/server.ts:117-132 (schema)The MCP tool schema definition for 'get_compliance_report', including the required 'framework' argument.
{ name: "get_compliance_report", description: "Generate a compliance report mapped to a specific framework. " + "Aggregates all receipts tagged with the specified framework.", inputSchema: { type: "object" as const, properties: { framework: { type: "string", description: "Compliance framework (HIPAA, SOX, NIST, SOC2, CMMC, ISO27001)", }, }, required: ["framework"], },