TsgcWSAPIServer_MCPEvents › OnMCPResponseElicitationCreate

OnMCPResponseElicitationCreate Event

Receives the client’s reply to RequestElicitationCreate with the elicited values.

Syntax

property OnMCPResponseElicitationCreate: TsgcAI_MCP_Server_OnResponseElicitationCreateMessageEvent;
// TsgcAI_MCP_Server_OnResponseElicitationCreateMessageEvent = procedure(Sender: TObject; const aSession: TsgcAI_MCP_Session; const aRequest: TsgcAI_MCP_Request_ElicitationCreate; const aResponse: TsgcAI_MCP_Response_ElicitationCreate) of object

Default Value

Remarks

Raised when the client finishes an elicitation/create round started with RequestElicitationCreate. aResponse.Result.Action tells whether the user confirmed (accept), dismissed (decline) or cancelled (cancel) the dialog; when accepted, aResponse.Result.Content contains a JSON object that satisfies the RequestedSchema sent earlier. Validate and consume the values before resuming the tool call that triggered the elicitation.

Example

procedure TMainForm.MCPServerMCPResponseElicitationCreate(Sender: TObject;
  const aSession: TsgcAI_MCP_Session; const aRequest: TsgcAI_MCP_Request_ElicitationCreate;
  const aResponse: TsgcAI_MCP_Response_ElicitationCreate);
begin
  if aResponse.Result.Action = 'accept' then
    MemoLog.Lines.Add('deploymentId = ' + aResponse.Result.Content.Node['deploymentId'].AsString);
end;

Back to Events