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

Function call_tool

tests/interaction/lowlevel/test_elicitation.py:69–72  ·  view source on GitHub ↗
(ctx: ServerRequestContext, params: types.CallToolRequestParams)

Source from the content-addressed store, hash-verified

67 )
68
69 async def call_tool(ctx: ServerRequestContext, params: types.CallToolRequestParams) -> CallToolResult:
70 assert params.name == "signup"
71 answer = await ctx.session.elicit_form("Choose a username.", REQUESTED_SCHEMA)
72 return CallToolResult(content=[TextContent(text=answer.action)], structured_content=answer.content)
73
74 server = Server("registrar", on_list_tools=list_tools, on_call_tool=call_tool)
75

Callers

nothing calls this directly

Calls 7

CallToolResultClass · 0.90
TextContentClass · 0.90
send_elicit_completeMethod · 0.80
elicit_formMethod · 0.45
elicit_urlMethod · 0.45

Tested by

no test coverage detected