Skip to content

Add strict validation to enforce single action per request across all tool schemas#80

Merged
viratatwebflow merged 3 commits intomainfrom
sai
Feb 16, 2026
Merged

Add strict validation to enforce single action per request across all tool schemas#80
viratatwebflow merged 3 commits intomainfrom
sai

Conversation

@viratatwebflow
Copy link
Collaborator

  • Added .strict() to Zod action schemas across all 13 tool files to reject unrecognized keys, preventing typos or invalid fields from being silently ignored
  • Added .refine() validation to ensure each action entry contains at least one valid action, providing a clear error message when an empty object is passed

- Changed the type of the body parameter to use z.infer with WebflowPageSchema for better type safety.
- Extracted relevant fields (seo, openGraph, slug, title) from the body and constructed a new pageSettings object for cleaner updates.
- Updated the updatePageSettings call to merge the new pageSettings with the existing body, ensuring a more structured request.
- Updated input schemas across multiple tools (cms, comments, components, deAsset, deComponents, deElement, dePages, deStyle) to ensure consistent structure and validation using zod.
- Implemented strict validation and refined checks to enforce single action requirements in deAsset, deComponents, and dePages tools.
- Enhanced descriptions and organization of schema properties for improved clarity and usability.
- Modified validation checks in various tools (cms, comments, components, deAsset, deComponents, deElement, dePages, deStyle, deVariable, enterprise, scripts, sites) to require at least one action instead of exactly one.
- Updated error messages to reflect the new validation criteria, enhancing user guidance for input requirements.
@viratatwebflow viratatwebflow requested a review from a team as a code owner February 16, 2026 16:05
@viratatwebflow viratatwebflow requested review from bertenator and removed request for a team February 16, 2026 16:05
@viratatwebflow viratatwebflow merged commit c0b5084 into main Feb 16, 2026
6 checks passed
@viratatwebflow viratatwebflow deleted the sai branch February 16, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant