Skip to content

MCP server can’t properly handle tool without args #453

Closed
@lingbingjiang

Description

@lingbingjiang

Describe the bug
A clear and concise description of what the bug is.
MCP server currently set request handler of tool calling without args (no zod shape) called directly, without {}. However toolcallback type expects it. It is even worse when you use tool annotation.

To Reproduce
Steps to reproduce the behavior:

  1. Create a tool without args by MCPServer.tool(name, desc, {}, function)
  2. try to access extra as a parameter in the function. The type ToolCallback breaks.
  3. it is worse when using tool annotation.

Expected behavior
A clear and concise description of what you expected to happen.
You can get inferred correct type of extra in the mcpserver.tool

Logs
If applicable, add logs to help explain your problem.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

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