OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

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

Open createthis opened this issue 8 months ago • 1 comments

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

  • [x] 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

createthis avatar May 12 '25 14:05 createthis