Customer Info Validator
by YanKe1816
README.md
# Customer Info Validator
Customer Info Validator is a Gate 2 Cloudflare Workers + TypeScript MCP app for checking whether caller-provided customer information contains all caller-specified required fields.
## App Identity
- App Name: Customer Info Validator
- App Slug: customer-info-validator
- Version: 1.0.0
- App Type: Validator
- Hub: Sales / Customer Operations Hub
- GitHub Repo: customer-info-validator
- Cloudflare Worker Name: customer-info-validator
- Wrangler name: customer-info-validator
- Website URL: https://customer-info-validator.sidcraigau.workers.dev
- MCP URL: https://customer-info-validator.sidcraigau.workers.dev/mcp
- Support Email: sidcraigau@gmail.com
## Use Case
The only supported use case is validating customer information completeness. The tool accepts a customer information object and a caller-provided required field list, then returns checked fields, present fields, missing fields, completeness status, source label, and structured errors.
## MCP Tool
- Tool Name: `validate_customer_info_completeness`
- Tool Title: Validate Customer Information Completeness
### Input
- `customer_info`: object, required, allows arbitrary caller-provided customer fields.
- `required_fields`: array of strings, required, runtime validates empty arrays and blank field names.
- `source_label`: string, optional.
- `request_intent`: string, optional, used only to reject out-of-scope requests.
### Output
Every tool response returns the same top-level structure:
- `status`: `success` or `error`
- `complete`: boolean
- `required_fields`: string array
- `checked_fields`: string array
- `present_fields`: string array
- `missing_fields`: string array
- `source_label`: string
- `errors`: structured error array
## Error Contract
Supported error codes:
- `missing_required_input`
- `invalid_input_type`
- `empty_input`
- `out_of_scope`
- `internal_error`
Each error object includes `code`, `message`, and `field`.
## Out of Scope
The app does not infer or fabricate missing information, score customers, predict conversion, create sales strategies, contact customers, write to CRM systems, create follow-up tasks, generate or send quotations, approve, publish, submit, purchase, transfer, delete, call external APIs, or modify external systems.
## Routes
- `GET /`: minimal public HTML page.
- `GET /health`: returns `{ "status": "ok" }`.
- `POST /mcp`: JSON-RPC MCP endpoint supporting `initialize`, `tools/list`, and `tools/call`.
The app does not use `/sse`, `/`, or `/{app-slug}/mcp` as an MCP endpoint.
## Local Commands
```bash
npm install
npm run typecheck
npm run dev
npm run test:mcp:local
```
`npm run test:mcp:local` starts the local Worker, waits for health, exercises the HTTP and MCP routes, validates tool annotations, runs positive and error cases, checks unknown tool behavior, validates `structuredContent` against `outputSchema`, and exits nonzero on failure.
## Safety Architecture
Current architecture is read-only, stateless, and local to caller-provided input. It has no login, OAuth, database, external API client, CRM write path, message sending, form submission, approval action, purchase action, transfer action, or external system mutation.
## Schema / Runtime Boundary
The JSON Schema defines field names, primitive types, arrays, objects, and top-level `additionalProperties: false`. Runtime type validation still checks every argument and field type. Business validation handles empty `customer_info`, empty `required_fields`, blank field names, field trimming, de-duplication, valid content checks, and out-of-scope `request_intent` detection so business errors are returned through the structured Error Contract.
Processing order:
1. arguments
2. runtime type validation
3. business validation
4. deterministic completeness logic
5. unified response builder
## Deployment Sync Rule
Any future production code change must follow:
Code Patch -> Build -> Deploy -> Production Verification
Patch-after-deploy drift is not allowed. Formal deployment and production verification are not part of Gate 2 and must be performed only in the appropriate later gate.
## Gate Status
This repository is currently scoped to Gate 2 Build + Connect. It has not performed Gate 2.5 Developer Mode real listing tests, formal production deployment, formal submission, or final audit approval.
This server cannot be deployed
Maintenance
ActivitySlowing
ResponsivenessNo issues