@adcp/sdk API Reference - v7.9.0
    Preparing search index...

    Interface TaskResultMetadata

    Task execution metadata, shared across all result variants.

    interface TaskResultMetadata {
        taskId: string;
        contextId?: string;
        serverTaskId?: string;
        taskName: string;
        agent: { id: string; name: string; protocol: "mcp" | "a2a" };
        responseTimeMs: number;
        timestamp: string;
        clarificationRounds: number;
        status: TaskStatus;
        inputRequest?: InputRequest;
        idempotency_key?: string;
        replayed?: boolean;
    }
    Index

    Properties

    taskId: string

    Client-minted correlation id for this specific request attempt. Used for internal tracking (activeTasks map, webhook URL macros, debug logs) and retried/refired across attempts — NOT the A2A task id the server is tracking. For the server-side id, use serverTaskId.

    contextId?: string

    Server-returned A2A contextId / AdCP context_id that binds this response to a server-side conversation. Present when the server surfaced one; undefined otherwise (e.g., fire-and-forget MCP completions).

    Buyers who persist conversation across process restarts should save this and seed it into AgentClient.resetContext(id) on rehydration.

    serverTaskId?: string

    A2A taskId of the server-tracked task for this response. Populated from A2A Task / Message responses; undefined for MCP and for A2A responses that carry no task binding. Distinct from taskId, which is the client-minted correlation id.

    taskName: string
    agent: { id: string; name: string; protocol: "mcp" | "a2a" }
    responseTimeMs: number

    Total execution time in milliseconds

    timestamp: string

    ISO timestamp of completion

    clarificationRounds: number

    Number of clarification rounds

    status: TaskStatus

    Final status

    inputRequest?: InputRequest

    Input request details (for input-required status)

    idempotency_key?: string

    Idempotency key used for this request, when the tool is mutating. Auto- generated by the SDK when the caller doesn't supply one. Surfaced for logging, correlation, and BYOK flows where the caller persists the key alongside the resource it creates.

    replayed?: boolean

    True when the response was a cached replay from the seller's idempotency store (i.e., an earlier request with the same key already succeeded).

    Callers with side effects on response — "campaign created!" notifications, LLM memory writes, downstream tool calls — MUST check this flag before acting, or retries will re-fire side effects.