Tool names with special chars are rejected.
(self)
| 244 | |
| 245 | @pytest.mark.asyncio |
| 246 | async def test_invalid_tool_name_rejected(self): |
| 247 | """Tool names with special chars are rejected.""" |
| 248 | bridge, _ = _make_bridge() |
| 249 | msg = json.dumps( |
| 250 | { |
| 251 | "jsonrpc": "2.0", |
| 252 | "id": 11, |
| 253 | "method": "tools/call", |
| 254 | "params": {"name": "rm -rf /", "arguments": {}}, |
| 255 | } |
| 256 | ) |
| 257 | resp = await bridge.handle_message(msg) |
| 258 | parsed = json.loads(resp) |
| 259 | assert parsed["error"]["code"] == -32602 |
| 260 | |
| 261 | @pytest.mark.asyncio |
| 262 | async def test_empty_tool_name_rejected(self): |
nothing calls this directly
no test coverage detected