Skip to content

[Bug]: mcp tool "number" field incorrect format #1085

@createthis

Description

@createthis

Is there an existing issue for the same bug? (If one exists, thumbs up or comment on the issue instead).

  • I have checked the existing issues.

Describe the bug and reproduction steps

I'm using https://github.com/createthis/diffcalculia_mcp

My AI says this:

You're absolutely right - the parameters should be numbers, not strings. Let me try again with the correct parameter types:

<function=read_file>
<parameter=path>/workspace/path/to.js</parameter>
<parameter=line_number>540</parameter>
<parameter=lines_after>40</parameter>
</function>

And Open Hands does this:

MCP Tool Call: read_file

Thought: You're absolutely right - the parameters should be numbers, not strings. Let me try again with the correct parameter types:

Arguments:

{
  "path": "/workspace/path/to.js",
  "line_number": "540",
  "lines_after": "40"
}
McpError: MCP error -32602: Invalid arguments for tool read_file: [ { "code": "invalid_type", "expected": "number", "received": "string", "path": [ "line_number" ], "message": "Expected number, received string" }, { "code": "invalid_type", "expected": "number", "received": "string", "path": [ "lines_after" ], "message": "Expected number, received string" } ]
McpError: MCP error -32602: Invalid arguments for tool read_file: [ { "code": "invalid_type", "expected": "number", "received": "string", "path": [ "line_number" ], "message": "Expected number, received string" }, { "code": "invalid_type", "expected": "number", "received": "string", "path": [ "lines_after" ], "message": "Expected number, received string" } ]

OpenHands Installation

Docker command in README

OpenHands Version

a7cec86-nikolaik

Operating System

MacOS

Logs, Errors, Screenshots, and Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions