Skip to content

[Bug]: MCP error -32602: Invalid arguments for tool... #391

@jleonelion

Description

@jleonelion

Version

About two weeks ago, I configured my Claude Desktop to use the Mongo MCP (via Docker) and it's been working great!

At some point in the last day or two, this setup started having problems and now fails regularly. I didn't change any of my configuration files but I suspect auto-updates may have crept in. It looks like Claude is not sending the necessary arguments when making tool calls, resulting in logs like:

025-07-23T06:11:18.838Z [collectibles-mongodb] [info] Message from client: {"method":"tools/call","params":{"name":"list-collections"},"jsonrpc":"2.0","id":5} { metadata: undefined }
2025-07-23T06:11:18.842Z [collectibles-mongodb] [info] Message from server: {"jsonrpc":"2.0","id":5,"error":{"code":-32602,"message":"MCP error -32602: Invalid arguments for tool list-collections: [\n  {\n    \"code\": \"invalid_type\",\n    \"expected\": \"string\",\n    \"received\": \"undefined\",\n    \"path\": [\n      \"database\"\n    ],\n    \"message\": \"Required\"\n  }\n]"}} { metadata: undefined }

I initially thought the problem was related to updates in the "latest" version of the docker image hosting the MCP server. After trying older versions of the image (ex. mongodb/mongodb-mcp-server:0.1.3-2025-07-09) the problem persists.

I also tried using different models (ex. Claude Sonnet 4, Claude Sonnet 3.7, Claude Haiku 3.5) and I continue to see regular errors.

  • list-databases works consistently (but that has not arguments)
  • list-collections works most of the time, but it does fail (see logs above)
  • count intermittently fails
  • find frequently fails

I haven't exercised every tool, but I think you get the point. The difficult thing to nail down is this doesn't happen every time, but it does happen frequently enough to make it unusable.

What could be causing this?

App

  • Cursor
  • Windsurf
  • VSCode
  • VSCode Insiders
  • Claude Desktop
  • Other

Affected Models (if applicable)

  • Claude 3.5 Sonnet
  • Claude 3.7 Sonnet
  • GPT-4a
  • o4-mini
  • Other

Bug Description

Tool calls are intermittently failing with errors and a response Error executing code: Cannot convert undefined or null to object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions