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

    Interface TransportOptions

    Transport-level safeguards applied to a call.

    Wired into the SDK's internal fetch chain via AsyncLocalStorage, so the cap takes effect even when the underlying transport's connection cache reuses a fetch that was created on an earlier call with different limits.

    interface TransportOptions {
        maxResponseBytes?: number;
    }
    Index

    Properties

    maxResponseBytes?: number

    Maximum response body size (in octets) the SDK will read before aborting with ResponseTooLargeError. When unset, the SDK does not impose a cap — matches the underlying MCP / A2A transport defaults.

    Set this when crawling untrusted agents (registries, federated discovery layers, monitoring tools) to prevent a hostile vendor from buffering a large reply before any application-layer schema validation runs. Counted across response chunks; pre-cancels when Content-Length exceeds the cap. Applies to A2A agent-card discovery (/.well-known/agent.json) on the same call as well.

    Per-call override (TaskOptions.transport.maxResponseBytes) beats the value set on the client constructor (SingleAgentClientConfig.transport).

    Safe to set on all calls. SSE responses (text/event-stream) are passed through unchanged — a single tool call legitimately emits N status frames + a final result, bounded by protocol-level framing rather than cumulative byte counts. The cap applies to one-shot JSON responses (get_adcp_capabilities, agent-card lookup, tool result payloads on non-streaming transports) where the body is bounded by definition.