fix: reorder variation variable union types and improve MCP descriptions for correct JSON typing#559
Open
jonathannorris wants to merge 1 commit intomainfrom
Open
fix: reorder variation variable union types and improve MCP descriptions for correct JSON typing#559jonathannorris wants to merge 1 commit intomainfrom
jonathannorris wants to merge 1 commit intomainfrom
Conversation
8c880e9 to
90ad2e5
Compare
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
devcycle-mcp-server | 33c2e65 | Mar 12 2026, 07:53 PM |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the advertised JSON Schema / MCP tool documentation for variation variables to better steer MCP tool callers toward using native JSON booleans/numbers (instead of string-encoding), addressing user-reported failures when the DevCycle API expects typed variable values.
Changes:
- Reorders the Zod union member ordering for variation
variablesacross multiple variation DTOs (to changeanyOfordering in generated JSON Schema). - Expands MCP tool argument descriptions to explicitly instruct using native JSON types (with examples) when populating variation
variables.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/mcp/types.ts |
Updates tool argument descriptions for variations/variables to explicitly request native JSON typing and provide examples. |
src/api/zodSchemas.ts |
Reorders union type members for variation variables to prioritize boolean/number before string in generated schema output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…ons for correct JSON typing
90ad2e5 to
33c2e65
Compare
cdruxerman
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
variablesto putbooleanandnumberbeforestringacross all 5 variation schemasMotivation
Users reported that creating/updating features with boolean variation variables via MCP fails with:
The root cause is that AI models send
"true"(string) instead oftrue(boolean) when calling the MCP tools. No serialization bug exists in our code — the issue is AI model behavior. Our Zod validation accepts"true"becausez.string()matches beforez.boolean()is tried, so the error only surfaces when the DevCycle API rejects the request.Changes
src/api/zodSchemas.ts— Reordered union from[string, number, boolean, ...]to[boolean, number, string, ...]inCreateVariationDto,Variation,UpdateVariationDto,FeatureVariationDto, andUpdateFeatureVariationDto. This changes theanyOforder in the advertised JSON Schema. It's a loose theory that havingstringfirst inanyOfinfluences models to default to string encoding — worth trying but not guaranteed to fix the issue on its own.src/mcp/types.ts— Enhanced descriptions onCreateFeatureArgsSchema.variations,UpdateFeatureArgsSchema.variations, and the sharedvariablesDescriptionused by standalone variation tools. Descriptions now explicitly state to use native JSON types with examples. This is likely the more impactful change since models tend to follow explicit instructions in tool descriptions.