(method: str, params: dict, request_id)
| 57 | |
| 58 | |
| 59 | def handle_request(method: str, params: dict, request_id) -> None: |
| 60 | if method == "initialize": |
| 61 | send_response( |
| 62 | request_id, |
| 63 | result={ |
| 64 | "protocolVersion": PROTOCOL_VERSION, |
| 65 | "capabilities": {"tools": {"listChanged": False}}, |
| 66 | "serverInfo": {"name": SERVER_NAME, "version": SERVER_VERSION}, |
| 67 | }, |
| 68 | ) |
| 69 | log("initialize -> ok") |
| 70 | return |
| 71 | |
| 72 | if method == "tools/list": |
| 73 | send_response(request_id, result={"tools": []}) |
| 74 | return |
| 75 | |
| 76 | if method == "tools/call": |
| 77 | send_response( |
| 78 | request_id, |
| 79 | error={"code": -32601, "message": "no tools available on this server"}, |
| 80 | ) |
| 81 | return |
| 82 | |
| 83 | send_response( |
| 84 | request_id, |
| 85 | error={"code": -32601, "message": f"method not found: {method}"}, |
| 86 | ) |
| 87 | |
| 88 | |
| 89 | def handle_notification(method: str, params: dict) -> None: |
no test coverage detected