I am receiving a 400 invalid_request_error on basic text prompts. No tools are being called on my end.
Error: tools.function.parameters is not a valid moonshot flavored json schema, details: <At path 'properties.variantOptions': conflicting keywords found after $ref expansion: description>
Request IDs: 2_1780195213442, 4_1780196536133 Time: 2026-05-30 ~20:06 UTC
This is completely blocking my ability to use the service. Please escalate to engineering immediately.
The 400 invalid_request_error indicates a JSON Schema validation failure. Even if no tools are explicitly invoked in the text prompt, the underlying framework or SDK often attaches global tool definitions to the request body by default.
The specific error at properties.variantOptions is a structural conflict identified by walle, the JSON schema validator used by Moonshot AI.
When a $ref is expanded, having a description keyword at the $ref sibling level while the referenced subschema also contains a description creates a keyword conflict. The validator cannot determine which description takes precedence.
To resolve this issue:
- Inspect the raw request: Intercept the actual HTTP request body to locate the injected
tools array.
- Resolve the
$ref conflict: Delete either the sibling description next to the $ref, or the description inside the referenced subschema.
For example, change this:
"variantOptions": {
"$ref": "#/$defs/VariantType",
"description": "Conflicting sibling description"
}
To this:
"variantOptions": {
"$ref": "#/$defs/VariantType"
}
To prevent similar issues in the development loop, it is effective to run tool schemas through local validation using the walle CLI/library (GitHub - MoonshotAI/walle ยท GitHub) prior to API submission.