TsgcWSAPIClient_MCP › Methods › TasksGet

TasksGet Method

Requests the status of a task (tasks/get) and returns it.

Syntax

function TasksGet(const aTaskId: string): TsgcAI_MCP_TaskStatus;

Parameters

NameTypeDescription
aTaskIdconst stringId of the task, from OnMCPTaskCreated.

Remarks

Requires the protocol version 2026-07-28; in the legacy era the method raises an exception. Raises OnMCPTaskStatus with the full task and returns aimcptskWorking, aimcptskInputRequired, aimcptskCompleted, aimcptskFailed or aimcptskCancelled. Use it when MCPOptions.Tasks.AutoPoll is False.

See Tasks.

Example

if MCP.TasksGet(FTaskId) = aimcptskCompleted then
  Log('done');

Back to Methods