MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_invalid_tool_name_rejected

Method test_invalid_tool_name_rejected

tests/apps/test_bridge.py:246–259  ·  view source on GitHub ↗

Tool names with special chars are rejected.

(self)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 2

handle_messageMethod · 0.80
_make_bridgeFunction · 0.70

Tested by

no test coverage detected