Skip to content

mcp: accept whole-number float maxResults values from clients #326

@kuishou68

Description

@kuishou68

Summary

The MCP server currently rejects maxResults when some clients serialize it as an integral float like 30.0.

Reproduction

A request like this fails today:

{
  "patterns": ["AgentTool"],
  "constraints": "*.{ts,tsx} src/js/my-app/",
  "maxResults": 30.0
}

Actual

Deserialization fails with:

invalid type: floating point `30.0`, expected usize

Expected

Whole-number floats from MCP clients should be accepted as the equivalent integer value, while fractional values like 30.5 should still be rejected.

Why this matters

A few MCP clients / AI tool wrappers emit JSON numbers as floats even when the logical value is integral. Being strict here creates avoidable interoperability failures for an otherwise safe parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions