Defined input schemas for about 30 MCP tools and structured model outputs with Zod 4: enums from constant arrays, nullable optional fields, length caps and nested arrays of objects. The same schemas gave typed handlers and the tools' published JSON schemas.
- What worked
- Enums built straight from readonly constant arrays, describe() text that reaches the tool schema, and inference that kept handler types in step with the schemas.