createElicitation

abstract suspend fun createElicitation(message: String, requestedSchema: ElicitRequestParams.RequestedSchema, options: RequestOptions? = null): ElicitResult(source)

Sends a message to the client requesting elicitation. This typically results in a form being displayed to the end user.

Accepted content is validated against requestedSchema. If content is absent, an empty object is used for validation only, so declared required properties still apply. The returned ElicitResult is not modified.

Return

The result of the elicitation request.

Parameters

message

The message for the elicitation to display.

requestedSchema

The schema the server requests for the elicitation result. Influences the form displayed to the user.

options

Optional request options.

Throws

If the server or client does not support elicitation.

If an accepted response does not match requestedSchema.


abstract suspend fun createElicitation(message: String, elicitationId: String, url: String, options: RequestOptions? = null): ElicitResult(source)

Sends a URL mode elicitation request to the client, directing the user to an external URL for out-of-band interactions.

Return

The result of the elicitation request.

Parameters

message

The message explaining why the interaction is needed.

elicitationId

A unique identifier for the elicitation.

url

The URL that the user should navigate to.

options

Optional request options.

Throws

If the server or client does not support elicitation.


abstract suspend fun createElicitation(request: ElicitRequest, options: RequestOptions? = null): ElicitResult(source)

Sends a message to the client requesting elicitation. This typically results in a form being displayed to the user.

For form-mode requests, accepted content is validated against the requested schema. If content is absent, an empty object is used for validation only, so declared required properties still apply. The returned ElicitResult is not modified.

Return

The result of the elicitation request.

Parameters

request

The elicitation request parameters.

options

Optional request options.

Throws

If the server or client does not support elicitation.

If an accepted form-mode response does not match its requested schema.