onSamplingRequestMap method

  1. @override
void onSamplingRequestMap(
  1. Future<Map<String, dynamic>> handler(
    1. Map<String, dynamic> params
    )
)
override

Map-based variant of onSamplingRequest. Receives the request's params as a raw map and must return the raw CreateMessageResult map.

Exists so generic adapters (notably mcp_llm's LlmClientAdapter) can register a handler without importing the typed CreateMessageRequestParams / CreateMessageResult models — the typed entry point's signature would otherwise fail the runtime function subtype check at dynamic dispatch time.

Implementation

@override
void onSamplingRequestMap(
  Future<Map<String, dynamic>> Function(Map<String, dynamic> params) handler,
) => inner.onSamplingRequestMap(handler);