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

Method elicit_form

src/mcp/server/session.py:281–310  ·  view source on GitHub ↗

Send a form mode elicitation/create request. Args: message: The message to present to the user. requested_schema: Schema defining the expected response structure. related_request_id: Optional ID of the request that triggered this elicitation. Ret

(
        self,
        message: str,
        requested_schema: types.ElicitRequestedSchema,
        related_request_id: types.RequestId | None = None,
    )

Source from the content-addressed store, hash-verified

279 return await self.elicit_form(message, requested_schema, related_request_id)
280
281 async def elicit_form(
282 self,
283 message: str,
284 requested_schema: types.ElicitRequestedSchema,
285 related_request_id: types.RequestId | None = None,
286 ) -> types.ElicitResult:
287 """Send a form mode elicitation/create request.
288
289 Args:
290 message: The message to present to the user.
291 requested_schema: Schema defining the expected response structure.
292 related_request_id: Optional ID of the request that triggered this elicitation.
293
294 Returns:
295 The client's response with form data.
296
297 Raises:
298 NoBackChannelError: The connection has no back-channel for
299 server-initiated requests.
300 """
301 return await self.send_request(
302 types.ElicitRequest(
303 params=types.ElicitRequestFormParams(
304 message=message,
305 requested_schema=requested_schema,
306 ),
307 ),
308 types.ElicitResult,
309 metadata=ServerMessageMetadata(related_request_id=related_request_id),
310 )
311
312 async def elicit_url(
313 self,

Callers 2

elicitMethod · 0.95
elicit_with_validationFunction · 0.45

Calls 2

send_requestMethod · 0.95

Tested by

no test coverage detected