Agentic event store and enterprise audit infrastructure for Apex Financial Services — event-sourced loan ledger with MCP tools for commands and CQRS projections
The Ledger defines 8 tools with complete input schemas and descriptions. Naming follows verb_noun convention (submit_application, record_credit_analysis). Descriptions are detailed and include preconditions and error guidance (e.g., 'REQUIRES active agent session', 'May raise OptimisticConcurrencyError'). However, output schemas are not documented, responses are JSON strings without declared field structures. Parameter descriptions are present but some lack constraint details (e.g., confidence is 0.0-1.0 but not explicitly bounded in schema). Error handling is structured (error_type, message, suggested_action) but recovery paths are sometimes vague. No tool annotations (readOnlyHint, destructiveHint, idempotentHint) are present.
Generate decision. All analyses must be present; confidence < 0.6 forces REFER.
Record compliance check result. rule_id must exist in regulation set (REG-001..REG-006). May raise DomainError.
Record credit analysis completion. REQUIRES active agent session from start_agent_session. May raise OptimisticConcurrencyError — suggested_action: reload_stream_and_retry.
Record fraud screening completion. REQUIRES active agent session.
Record human review. If override=True, override_reason is required.
Run integrity check on audit chain. Compliance role only; rate limit 1/min per entity.
Output schemas not documented. Tools return JSON strings but field structures are not declared. LLMs cannot plan downstream calls or extract specific fields without trial-and-error parsing.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint). All 7 write tools lack destructiveHint; run_integrity_check lacks readOnlyHint. Agents cannot distinguish safe from risky operations.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 62 | 2026-07-28+ | v2 |
Start an agent session (Gas Town pattern). REQUIRED before record_credit_analysis, record_fraud_screening, or generate_decision. Call this first or you will get PreconditionFailed.
Submit a new loan application. Returns stream_id and initial version. Precondition: application_id must not already exist.
Numeric parameter constraints not enforced in schema. confidence (0.0-1.0), fraud_score (0.0-1.0), and requested_amount_usd lack minimum/maximum bounds in JSON Schema. LLMs may pass invalid values.
Enum constraints missing for categorical parameters. risk_tier, recommendation, final_decision, and rule_id accept free-form strings instead of enums. LLMs may hallucinate invalid values (e.g., 'MAYBE' instead of 'REFER').
Error recovery guidance incomplete. record_credit_analysis mentions 'reload_stream_and_retry' but does not explain how to reload or what version to expect. Agents lack actionable next steps.