Skip to content

Can't call tools #110

Closed
Closed

Description

@WriterZephos

Describe the bug
A clear and concise description of what the bug is.

Using the example tool in the readme and running that script to open a stdio server, you cannot call the tool with json_rpc. It returns an error.

To Reproduce
Steps to reproduce the behavior:

  1. Copy the example tool script from the readme into a ruby file and run it: ruby <file.rb>
  2. use json rpc in the same console to request the tool:
{"jsonrpc":"2.0","id":"2","method":"tools/call", "params":{"name":"example_tool"}}
{"jsonrpc":"2.0","id":"2","error":{"code":-32603,"message":"Internal error","data":"Internal error handling tools/call request"}}

Expected behavior
It should run the tool and give the proper output.

Activity

  1. atesgoral commented on Aug 20, 2025

    @atesgoral
    Contributor

    @WriterZephos Are you using param instead of params or was that a typo in the issue description?

  2. WriterZephos commented on Aug 25, 2025

    @WriterZephos
    Author

    @atesgoral That was a mistake in the issue description. I replaced it with a copy directly from my terminal.

  3. koic commented on Aug 29, 2025

    @koic
    Member

    As shown in the tools/list response with "required":["message"], the message field is mandatory.

    {"jsonrpc":"2.0","id":"2","method":"tools/list"}
    {"jsonrpc":"2.0","id":"2","result":{"tools":[{"name":"example_tool","description":"A simple example tool that echoes back its arguments","inputSchema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}]}}

    Therefore, the tools/call request must include this required argument "message", for example:

    {"jsonrpc":"2.0","id":"3","method":"tools/call","params":{"name":"example_tool","arguments":{"message":"Hello"}}}

    I’ve opened #120 to add a tools/call example to the README.

    In the next release of the mcp gem, the error message will be updated as shown below, which should make it easier to identify the cause compared to the current mcp 0.2.0.

    Before:

    {"jsonrpc":"2.0","id":"2","method":"tools/call", "params":{"name":"example_tool"}}
    {"jsonrpc":"2.0","id":"2","error":{"code":-32603,"message":"Internal error","data":"Internal error handling tools/call request"}}

    After:

    {"jsonrpc":"2.0","id":"2","method":"tools/call", "params":{"name":"example_tool"}}
    {"jsonrpc":"2.0","id":"2","error":{"code":-32603,"message":"Internal error","data":"Missing required arguments: message"}}
  4. added
    documentationImprovements or additions to documentation
    and removed
    bugSomething isn't working
    on Aug 29, 2025
  5. added a commit that references this issue on Aug 29, 2025
    da4fd64
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

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions