Merge pull request #21 from modelcontextprotocol/davidsp/call-tool

Pass arguments as a dictionary instead of spreading them into kwargs
This commit is contained in:
David Soria Parra
2024-10-21 15:54:44 +01:00
committed by GitHub

View File

@@ -274,7 +274,7 @@ class Server:
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