MoonshotAI / MoonshotAI/kimi-code

400 error: "tools.function.parameters is not a valid moonshot flavored json schema" when using custom API endpoint with MCP tools

Open
#1,610 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

What version of Kimi Code is running?

0.23.6

Which open platform/subscription were you using?

Allegretto subscription

Which model were you using?

kimi-for-coding

What platform is your computer?

Windows 11 Home China 10.0.26200 x64

What issue are you seeing?

When using a custom API endpoint with multiple MCP servers configured,the LLM request fails with:
APIStatusError: 400 tools.function.parameters is not a valid moonshot flavored json schema, details: <At path 'properties.workFlow.items.required': required property 'codecType' is not defined in properties> At the time of the error, 255 tools were registered across multiple MCP servers. The Moonshot API appears to do stricter JSON Schema validation than standard OpenAI-compatible APIs.

What steps can reproduce the bug?
  1. Configure multiple MCP servers (playwright, firecrawl, etc.)
  2. Set a custom API endpoint
  3. Send any prompt
  4. Request fails before reaching the model
What is the expected behavior?
  • Client-side schema validation to filter invalid tool schemas
    before sending
    • Or graceful degradation: retry with problematic tools removed
    • Or a clearer error message indicating which MCP server/tool
      caused the issue @
Additional information

One of the MCP tools has a "required" array referencing
"codecType" which is not defined in "properties" of that object.
This violates strict JSON Schema validation.

session_d40255e5-91fc-4529-821b-2a4835b2df2a.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing custom API request handling and MCP tool registration to see how tool schemas are passed to the Moonshot endpoint. Reproduce the failure with multiple MCP servers and inspect the schema containing a required codecType not present in properties. Done means invalid schemas are handled before the request or the resulting error identifies the responsible tool or server.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, typescript
Domain
api, backend, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.