MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / test_list_prompts

Function test_list_prompts

tests/client/test_client.py:333–347  ·  view source on GitHub ↗

Test listing prompts with params parameter.

(app: MCPServer)

Source from the content-addressed store, hash-verified

331
332
333async def test_list_prompts(app: MCPServer):
334 """Test listing prompts with params parameter."""
335 async with Client(app) as client:
336 result = await client.list_prompts()
337 assert result == snapshot(
338 ListPromptsResult(
339 prompts=[
340 Prompt(
341 name="greeting_prompt",
342 description="A greeting prompt.",
343 arguments=[PromptArgument(name="name", required=True)],
344 )
345 ]
346 )
347 )
348
349
350async def test_complete_with_prompt_reference(simple_server: Server):

Callers

nothing calls this directly

Calls 5

ClientClass · 0.90
ListPromptsResultClass · 0.90
PromptClass · 0.90
PromptArgumentClass · 0.90
list_promptsMethod · 0.45

Tested by

no test coverage detected