Skip to content

fix: add helpful error for incorrect schema format and update CLI templates#148

Merged
QuantGeekDev merged 1 commit intomainfrom
fix/121-schema-error-and-templates
Apr 1, 2026
Merged

fix: add helpful error for incorrect schema format and update CLI templates#148
QuantGeekDev merged 1 commit intomainfrom
fix/121-schema-error-and-templates

Conversation

@QuantGeekDev
Copy link
Copy Markdown
Owner

Summary

  • Detects the common mistake of schema = { field: z.string() } (plain object with raw Zod types) and throws a clear error with the tool name and correct pattern
  • Updates mcp add tool and mcp create CLI templates to use the Zod-first z.object() pattern with MCPInput<this> for type inference
  • Removes legacy { type: z.string(), description: "..." } format from all templates

Test plan

  • 5 new tests pass in tests/tools/schema-validation.test.ts
  • Run mcp add tool test-tool and verify generated code uses z.object()
  • Verify legacy format tools still work (backward compatible)

Closes #121

🤖 Generated with Claude Code

…plates to Zod-first

Closes #121

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Throw bespoke error on incorrectly defined schemas with "z.string().describe()"

1 participant