update
This commit is contained in:
@@ -183,9 +183,9 @@ def test_all_mcp_tools_discoverable(client):
|
||||
for tool in tools:
|
||||
assert "name" in tool
|
||||
assert "description" in tool
|
||||
assert "input_schema" in tool
|
||||
assert "inputSchema" in tool
|
||||
assert tool["description"] # Not empty
|
||||
assert "type" in tool["input_schema"]
|
||||
assert "type" in tool["inputSchema"]
|
||||
|
||||
|
||||
def test_error_responses_include_helpful_messages(client):
|
||||
|
||||
@@ -126,7 +126,7 @@ def test_list_tools_with_valid_key(client, mock_env):
|
||||
tool = data["tools"][0]
|
||||
assert "name" in tool
|
||||
assert "description" in tool
|
||||
assert "input_schema" in tool
|
||||
assert "inputSchema" in tool
|
||||
|
||||
|
||||
def test_list_tools_with_query_param(client):
|
||||
@@ -149,6 +149,22 @@ def test_list_tools_no_auth_when_disabled(client_no_auth):
|
||||
assert "tools" in data
|
||||
|
||||
|
||||
def test_sse_tools_list_returns_camel_case_schema(client):
|
||||
"""SSE tools/list returns MCP-compatible camelCase inputSchema."""
|
||||
response = client.post(
|
||||
f"/mcp/sse?api_key={'a' * 64}",
|
||||
json={"jsonrpc": "2.0", "id": "1", "method": "tools/list"},
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert "result" in data
|
||||
assert "tools" in data["result"]
|
||||
tool = data["result"]["tools"][0]
|
||||
assert "inputSchema" in tool
|
||||
assert "type" in tool["inputSchema"]
|
||||
|
||||
|
||||
def test_call_tool_without_auth(client):
|
||||
"""Test that /mcp/tool/call requires authentication."""
|
||||
response = client.post("/mcp/tool/call", json={"tool": "list_repositories", "arguments": {}})
|
||||
|
||||
Reference in New Issue
Block a user