Skip to content

settings tool: mixed-type enum for idleMinutes breaks Kimi CLI #231

Closed

Description

@adusingi

Problem

With browse 0.0.16 configured as an MCP server in Kimi CLI (@moonshot-ai/kimi-code 2.5.3), every prompt fails before the model runs:

error: failed to run prompt: provider.api_error: Mixed JSON Schema enum or const types are not supported by Kimi tool schemas.

Cause

The settings tool's input schema has one enum whose values mix JSON types:

"idleMinutes": {
  "enum": [10, 30, 60, "never"],
  "description": "Close agent tabs untouched for this many minutes"
}

It is the only such enum across the 18 tools (input and output schemas checked). Kimi infers a type for each enum without one, and throws when the values have more than one type. It skips that inference for nodes with anyOf / oneOf / allOf / $ref.

The schema is valid JSON Schema, but some providers' tool-schema subsets reject it, and the whole tool list fails with it.

Suggested fix

Emit one single-type enum per branch, which accepts exactly the same values:

"idleMinutes": {
  "anyOf": [
    { "type": "integer", "enum": [10, 30, 60] },
    { "type": "string", "enum": ["never"] }
  ],
  "description": "Close agent tabs untouched for this many minutes"
}

(For example a union of a numeric-literal schema and a "never" literal schema, rather than one literal union over mixed types.) A test that every tool schema's enum / const values share one JSON type would keep this from coming back.

Workaround

A stdio wrapper around browse mcp that rewrites mixed enums in tools/list into the anyOf form above. With it, Kimi loads all 18 tools and calls status and settings normally.

Activity

  1. thdxr commented on Nov 11, 2026

    @thdxr
    Member

    the settings tool listed its idle timeout as one list mixing numbers and "never", and kimi rejects that, so every tool failed to load.

    now it's sent as two lists, one with just numbers and one with just "never". it accepts the same values as before, and there's a check so no tool can slip back into that.

    fixed in #232, it'll be in the next release

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions