Skip to content

fix(mcp): normalize tools for Moonshot API#2539

Open
lihailong00 wants to merge 1 commit into
MoonshotAI:mainfrom
lihailong00:codex/issue-2531-mcp-schema
Open

fix(mcp): normalize tools for Moonshot API#2539
lihailong00 wants to merge 1 commit into
MoonshotAI:mainfrom
lihailong00:codex/issue-2531-mcp-schema

Conversation

@lihailong00

@lihailong00 lihailong00 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • generate stable Moonshot-compatible aliases for MCP tool names while retaining original names for upstream call routing
  • add a missing root object type when an MCP schema defines object properties
  • distribute the exact object anyOf/required schema shape reported in the issue into equivalent Moonshot-compatible branches
  • leave unsupported complex combinator schemas unchanged

Validation

  • uv run pytest packages/kosong/tests/test_kimi_tool_conversion.py tests/core/test_mcp_tool_names.py -q (9 passed)
  • targeted Ruff check and format check passed
  • targeted Pyright check passed with 0 errors
  • remote compare verified: 1 commit, 4 intended files, 154 additions / 2 deletions

Closes #2531


Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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.

MCP tool names & schemas rejected by Moonshot API (HTTP 400) — sanitize client-side before sending

1 participant