McpClient.onSampling

Handler for sampling/createMessage; receives the typed CreateMessageRequest params and returns the typed CreateMessageResult. Null => unsupported (the client answers roots/list-style with Method not found). The SDK validates the request's tool-result message constraints (client/sampling §Error Handling) before invoking this.

class McpClient
CreateMessageResult delegate(CreateMessageRequest request) @(safe) onSampling;