MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / test_complex_inputs

Function test_complex_inputs

tests/test_examples.py:31–47  ·  view source on GitHub ↗

Test the complex inputs server

()

Source from the content-addressed store, hash-verified

29
30@pytest.mark.anyio
31async def test_complex_inputs():
32 """Test the complex inputs server"""
33 from examples.mcpserver.complex_inputs import mcp
34
35 async with Client(mcp) as client:
36 tank = {"shrimp": [{"name": "bob"}, {"name": "alice"}]}
37 result = await client.call_tool("name_shrimp", {"tank": tank, "extra_names": ["charlie"]})
38 assert result == snapshot(
39 CallToolResult(
40 content=[
41 TextContent(text="bob"),
42 TextContent(text="alice"),
43 TextContent(text="charlie"),
44 ],
45 structured_content={"result": ["bob", "alice", "charlie"]},
46 )
47 )
48
49
50@pytest.mark.anyio

Callers

nothing calls this directly

Calls 4

ClientClass · 0.90
CallToolResultClass · 0.90
TextContentClass · 0.90
call_toolMethod · 0.45

Tested by

no test coverage detected