TTMSMCPServer.RequestTaskElicitation Method
Collects user input in the middle of a running task, tagging the request with the task so the client can relate the two.
API unit family: TMS.MCP.Server
Declaring type: TTMSMCPServer
Inherited from: TTMSMCPCustomServer
Syntax
function RequestTaskElicitation(const ATaskId: string; const ARequest: TTMSMCPElicitRequest): TTMSMCPElicitResult;
Remarks
The task is moved to the input-required state, the blocking round trip is performed, and the task is returned to the working state afterwards. The restore also runs when the round trip raises, so a failed request does not leave the task stuck waiting for input. It is skipped when the task is no longer in the input-required state, which is what preserves a cancellation that arrived during the wait.
Parameters
| Name | Description |
|---|---|
ATaskId |
Identifier of the running task. |
ARequest |
Prompt message and the schema of the fields to collect. Its related-task identifier is set from ATaskId. |
Returns
Result reported by the client.
Exceptions
| Exception | Description |
|---|---|
Exception |
Raised when the task identifier is unknown, or for any reason a plain elicitation request can fail. |