TsgcWSAPIServer_MCP › Events › OnMCPTaskUpdate

OnMCPTaskUpdate Event

Raised when a client sends the requested input of a task with tasks/update.

Syntax

property OnMCPTaskUpdate: TsgcAI_MCP_Server_OnTaskUpdateEvent;
// TsgcAI_MCP_Server_OnTaskUpdateEvent = procedure(Sender: TObject; const aTask: TsgcAI_MCP_Task; const aInputResponses: string) of object

Default Value

—

Remarks

Part of the tasks extension of MCP 2026-07-28. After the application calls aTask.RequireInput, the client collects the inputs and sends them with tasks/update. aInputResponses is a raw JSON object with one member per input key. Read the answers, continue the work and finish the task with Complete or Fail. The event is published, so you can assign it in the Object Inspector or in code. See Tasks.

Example

procedure TMainForm.OnMCPTaskUpdateEvent(Sender: TObject;
  const aTask: TsgcAI_MCP_Task; const aInputResponses: string);
begin
  MemoLog.Lines.Add('#task_update ' + aTask.TaskId + ': ' + aInputResponses);
  aTask.Complete('{"content":[{"type":"text","text":"Approved"}]}');
end;

MCPServer.OnMCPTaskUpdate := OnMCPTaskUpdateEvent;

Back to Events