From fa3e145dacb19a90c325983df27cff04be7298ba Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Mon, 21 Oct 2024 15:44:47 +0100 Subject: [PATCH] Pass arguments as a dictionary instead of spreading them into kwargs --- mcp_python/server/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcp_python/server/__init__.py b/mcp_python/server/__init__.py index 38600a6ce..71b373d63 100644 --- a/mcp_python/server/__init__.py +++ b/mcp_python/server/__init__.py @@ -274,7 +274,7 @@ def decorator(func: Callable[..., Awaitable[Any]]): logger.debug("Registering handler for CallToolRequest") async def handler(req: CallToolRequest): - result = await func(req.params.name, **(req.params.arguments or {})) + result = await func(req.params.name, (req.params.arguments or {})) return ServerResult(CallToolResult(toolResult=result)) self.request_handlers[CallToolRequest] = handler