MCP server implementing CQRS event sourcing for loan application processing with command handlers (tools) and read projections (resources)
Server has well-structured tool definitions with complete input schemas and descriptions for all 10 tools. Naming follows verb_noun convention (start_, submit_, request_, record_, generate_, approve_, decline_). Descriptions are detailed and include preconditions, which is excellent for LLM guidance. However, parameter descriptions are missing entirely, the schema shows types and constraints but no descriptions explaining what each parameter controls. Output schemas are not documented. Error handling is mentioned in descriptions but not formalized with recovery guidance. No tool annotations (readOnlyHint, destructiveHint, idempotentHint) despite clear WRITE and IRREVERSIBLE risk classifications.
Approve a loan application and finalize it. PRECONDITION: application must be in ApprovedPendingHuman state. PRECONDITION: all required compliance checks must be passed. Returns stream_id and final_version.
Decline a loan application and finalize it. PRECONDITION: application must be in DeclinedPendingHuman state. Returns stream_id and final_version.
Generate a final decision recommendation for a loan application. PRECONDITION: all required compliance checks must be passed. PRECONDITION: contributing_agent_sessions must reference sessions that processed this application. Confidence floor: confidence_score < 0.6 forces recommendation = REFER regardless of input.
Record a compliance rule result (pass or fail) for a loan application. rule_id must exist in the active regulation_set_version. First call for an application creates the ComplianceRecord stream.
Record a completed credit analysis for a loan application. PRECONDITION: start_agent_session must have been called for this agent_id/session_id. PRECONDITION: application must be in AwaitingAnalysis state. Enforces optimistic concurrency on the loan stream — reload and retry on OptimisticConcurrencyError.
Parameter descriptions completely missing. Schema defines types and constraints but no descriptions explaining what each parameter controls or when to use it. LLMs cannot infer parameter meaning from names alone (e.g., 'context_source' defaults to 'event_replay' but no explanation of alternatives or purpose).
Output schemas not documented. Tools return structured data (stream_id, version, error objects) but no schema documentation tells LLMs what fields to expect or how to chain results to downstream tools.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 68 | 2026-07-28+ | v2 |
Record a completed fraud screening for a loan application. PRECONDITION: start_agent_session must have been called for this agent_id/session_id. fraud_score must be 0.0–1.0; values outside this range return ValidationError.
Record a human reviewer's final decision on a loan application. PRECONDITION: application must be in PendingDecision state. reviewer_id authentication is the caller's responsibility. If override=True, override_reason is required.
Advance a loan application from Submitted to AwaitingAnalysis and assign an agent. PRECONDITION: application must be in Submitted state. Must be called before record_credit_analysis. Returns stream_id and new_stream_version.
REQUIRED FIRST STEP: Start an agent session before calling any other agent tool. Writes an AgentContextLoaded event (Gas Town pattern). Calling record_credit_analysis or record_fraud_screening without first calling this tool will return a PreconditionFailed error.
Submit a new loan application. Creates a new LoanApplication stream. Returns stream_id and initial_version. Duplicate application_id returns DuplicateStreamError.
Tool annotations missing. Tools marked WRITE and IRREVERSIBLE in metadata but no destructiveHint or idempotentHint in schema. LLMs cannot distinguish safe-to-retry operations from irreversible ones without explicit annotations.
Error handling not formalized. Descriptions mention error types (PreconditionFailed, DuplicateStreamError, OptimisticConcurrencyError, ValidationError) but no structured error response schema or recovery guidance. LLMs receive raw error dicts without actionable next steps.
Precondition enforcement relies on LLM compliance. Tools document preconditions (e.g., 'start_agent_session must be called first') but no server-side validation prevents misuse. If LLM forgets to call start_agent_session, error is returned but not prevented.