TsgcWSAPIClient_MCP › Events › OnMCPTaskCreated
Fires when a tools/call returns a task handle instead of the tool result.
property OnMCPTaskCreated: TsgcAI_MCP_Client_OnTaskEvent;
// TsgcAI_MCP_Client_OnTaskEvent = procedure(Sender: TObject; const aTask: TsgcAI_MCP_Client_Task) of object
—
Raised before OnMCPResponseTool, which receives the raw task handle in aResponse.TaskResult. Store aTask.TaskId to call TasksGet, TasksUpdate or TasksCancel. Requires MCPOptions.Tasks.Enabled.
See Tasks.
procedure TMainForm.MCPTaskCreated(Sender: TObject;
const aTask: TsgcAI_MCP_Client_Task);
begin
FTaskId := aTask.TaskId;
end;