feat: add validation for missing name parameter in tools/call requests

This commit is contained in:
Oleksii Pylypchuk
2026-04-18 22:05:34 +03:00
committed by Igor Lins e Silva
parent 55d79dc8cd
commit a85d432b54
2 changed files with 20 additions and 0 deletions
+6
View File
@@ -2007,6 +2007,12 @@ def handle_request(request):
},
}
elif method == "tools/call":
if not isinstance(params, dict) or "name" not in params:
return {
"jsonrpc": "2.0",
"id": req_id,
"error": {"code": -32602, "message": "Invalid params: 'name' is required for tools/call"},
}
tool_name = params.get("name")
tool_args = params.get("arguments") or {}
if tool_name not in TOOLS: