test(mcp): register limit cases and discover configured tools

This commit is contained in:
Joshua Valluru 2026-10-20 16:37:13 -07:00
parent e579750ad4
commit 6a2253d458
2 changed files with 8 additions and 3 deletions

View file

@ -191,7 +191,10 @@
"tests/integration/observability/test_guardrail_effects.py::test_guardrail_denial_prevents_provider_and_preserves_allowed_control": [
"other.observability.guardrails.denial_prevents_provider_with_allowed_control"
],
"tests/integration/mcp/test_mcp_protocol_errors.py::test_tool_result_larger_than_one_mib_in_a_single_sse_event_reaches_the_caller": [
"tests/integration/mcp/test_mcp_protocol_errors.py::test_tool_result_larger_than_one_mib_in_a_single_sse_event_reaches_the_caller[67108864]": [
"other.mcp.transport.large_sse_tool_result_reaches_caller"
],
"tests/integration/mcp/test_mcp_protocol_errors.py::test_tool_result_larger_than_one_mib_in_a_single_sse_event_reaches_the_caller[4096]": [
"other.mcp.transport.large_sse_tool_result_reaches_caller"
],
"tests/integration/mcp/test_mcp_protocol_errors.py::test_jsonrpc_error_and_malformed_tool_result_remain_errors": [

View file

@ -168,9 +168,11 @@ def test_tool_result_larger_than_one_mib_in_a_single_sse_event_reaches_the_calle
config=config,
remove_environment=("DATABASE_URL", "DATABASE_URL_READ_REPLICA", "DIRECT_URL"),
) as gateway:
names: Final = tool_names(gateway, key, "big")
listed: Final = gateway.client.get("/mcp-rest/tools/list", headers={"x-litellm-api-key": key})
assert listed.status_code == 200, listed.text[:500]
assert {tool["name"] for tool in listed.json()["tools"]} == {"add"}
for size in (512, len(payload), 512):
response: Final = call_tool(gateway, key, "big", names["add"], {"size": size})
response: Final = call_tool(gateway, key, "big", "add", {"size": size})
assert response.status_code == 200, response.text[:500]
body: Final = response.json()
assert body["isError"] is (size > limit), response.text[:500]