-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
The form engine renders inputs from JSON Schema but does not validate before sending to the server. Required fields can be left empty, number fields can contain non-numeric text, and enum fields have no constraint checking. Users only discover input errors after the server rejects the call.
Proposed solution
Add client-side validation that runs when the user clicks Execute:
- Required fields: show inline error if empty
- Number/integer: validate type and min/max constraints
- String: validate minLength/maxLength/pattern
- Enum: ensure value is in allowed set
- Nested objects: recursively validate required properties
Show errors inline below each field with red text. Disable the Execute button while validation errors exist. This mirrors the UX of FastAPI's /docs Swagger UI.
Alternatives considered
Using a JSON Schema validation library (e.g., Ajv). For the subset of JSON Schema that MCP tools actually use, hand-written validation in the form components is simpler and avoids a heavy dependency.