@adcp/sdk API Reference - v10.0.1
    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;
        adcpVersion?: string;
        productPropertyPolicy?: {
            mode: ProductPropertyPolicyMode;
            ok: boolean;
            accepted_count: number;
            rejected_count: number;
            flagged_count: number;
            message?: string;
            request_property_list?: {
                list_id: string;
                agent_url: string;
                identifier_count?: number;
                cache_valid_until?: string;
                resolution_error?: string;
            };
            diagnostics: ProductPropertyPolicyDiagnostic[];
        };
        productPricingPolicy?: {
            ok: boolean;
            accepted_count: number;
            rejected_count: number;
            rejected_products: { index: number; product_id?: string }[];
        };
    }
    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.

    adcpVersion?: string

    Seller-served, release-precision AdCP version echoed on the response envelope. Present when the seller emits adcp_version (3.1+). Compare with the request's wire-normalized version, not a raw full-semver configuration pin, when detecting same-major downshift.

    productPropertyPolicy?: {
        mode: ProductPropertyPolicyMode;
        ok: boolean;
        accepted_count: number;
        rejected_count: number;
        flagged_count: number;
        message?: string;
        request_property_list?: {
            list_id: string;
            agent_url: string;
            identifier_count?: number;
            cache_valid_until?: string;
            resolution_error?: string;
        };
        diagnostics: ProductPropertyPolicyDiagnostic[];
    }

    Buyer-side product property policy enforcement summary for get_products. Present when the client evaluates a configured product property policy or enforces the request's property_list reference against the response.

    productPricingPolicy?: {
        ok: boolean;
        accepted_count: number;
        rejected_count: number;
        rejected_products: { index: number; product_id?: string }[];
    }

    Buyer-side pricing-options enforcement summary for get_products. Present when the client drops one or more products that arrived without a usable pricing_options[] array (a required, non-empty field in AdCP 3.1).