onElicitationRequest method

void onElicitationRequest(
  1. Future<Map<String, dynamic>> handler(
    1. Map<String, dynamic> params
    )
)

Register a handler for server-initiated elicitation/create requests (spec 2025-06-18). The handler shows the requested form to the user and returns { action, content? } per spec — action is accept / decline / cancel.

Calling this advertises the elicitation client capability.

Implementation

void onElicitationRequest(
  Future<Map<String, dynamic>> Function(Map<String, dynamic> params) handler,
) {
  _requestHandlers['elicitation/create'] = handler;
}