Key Identifiers
AdCP uses two distinct identifiers for different purposes:context_id vs task_id
context_id:
- Maps to A2A’s native Message/Task
contextId - Is managed in the A2A transport envelope, not inside the AdCP task body
- Is not an MCP request-body session mechanism
- Is correlation and routing metadata, not authorization
- Specific to individual requests that could be asynchronous
- Lives beyond the conversation
- Used for tracking operation progress over time
- Persists until the task completes (may be days for complex media buys)
- Can be referenced across different conversations or sessions
A2A usage example
Protocol Differences
- A2A: Conversation continuity uses native
contextIdin the A2A envelope. - MCP: Continuity, when offered, belongs to the transport session. Do not send an AdCP
context_idtool argument to create or resume it.
A2A Context
A2A carries conversation correlation in the native message envelope:MCP context
MCP callers send task arguments without an AdCP session identifier:context_id, MCP servers MUST ignore it. It cannot select session state, identity, account, authorization, task continuation, or idempotency scope. Use the MCP transport session, if provided, for ephemeral continuity and schema-declared task or resource identifiers for durable state.
What Context Maintains
An A2AcontextId can associate conversational state such as:
- Current media buy and products being discussed
- Search results and applied filters
- Conversation history and user intent
- User preferences expressed in the session
- Workflow state and temporary decisions
task_id, not context_id.
Extension Fields (ext)
Extension fields enable platform-specific functionality while maintaining protocol compatibility.
Schema Pattern
Extensions appear consistently across requests, responses, and domain objects:ext object:
- Is always optional (never required)
- Accepts any valid JSON structure
- Must be preserved by implementations (even unknown fields)
- Is not validated by AdCP schemas (implementation-specific validation allowed)
Namespacing (Critical)
Extensions MUST use vendor/platform namespacing:Application Context (context)
Context provides opaque correlation data that is echoed unchanged in responses and webhooks.
Key Properties
- Agents NEVER parse or use context to affect behavior
- Exists solely for the initiator’s internal tracking needs
- Echoed unchanged in responses and webhook payloads
Normative echo contract
Agents MUST obey the following rules. The compliance runner asserts on these literally, and buyers rely on them for correlation.- Echo on success. When the caller includes a top-level
contextobject on a request, the agent MUST include the same JSON value in the response. This applies whether the response status iscompleted,submitted,working,input-required, or any other terminal or intermediate state. - Echo on error. Failure responses MUST also echo the same
contextJSON value. Dropping context on the error path breaks correlation exactly when the buyer needs it most. Agents that returnadcp_error,errors[], or any other error envelope MUST still carry through the caller’scontext. - Echo on async updates. Push notifications, webhook payloads, and any subsequent messages the agent emits for the same operation MUST carry the original
context. The agent MUST NOT drop context between the initial response and a later status update — a buyer that correlated bycontext.trace_idexpects every message for that operation to surface the same trace. - No synthesis. When the caller does NOT provide a
contextobject, the agent MUST NOT fabricate one. Responses to context-less requests MUST omit thecontextfield (or emit it as null / absent per the transport’s normal serialization). Synthetic context from the agent side is a conformance failure — the whole point of context is that it is owned by the caller. - No mutation. Agents MUST NOT add, remove, rename, or change the JSON type or value of fields in the echoed context. JSON value equivalence applies: object member order and number lexical form are not types or values. For example,
{"a":1,"b":2}and{"b":2.0,"a":1.0}are equivalent for the echo rule. An integer-valued number remains an integer for JSON Schema validation when serialized with a zero fractional part, so A2A’s3→3.0serialization does not count as retyping. Changing the mathematical value does. Across A2A, the comparison value is the post-decodinggoogle.protobuf.Value; senders and receivers MUST enforce the A2A numeric domain. Verifiers MUST compare parsed JSON values; a verifier that hashes context SHOULD canonicalize the parsed value instead of hashing transport bytes. - No action. Agents MUST NOT parse, validate, log fields from, or branch on any value inside
context. Context is opaque to the agent — a value that looks like a structured identifier is not an invitation to interpret it.
Schema Pattern
Common Context Uses
- UI/Session tracking - Maintaining state across async operations
- Request correlation - Tracing requests through distributed systems
- Internal identifiers - Mapping to your internal data structures
- Organization context - Multi-tenant tracking
When to Use What
Use ext when:
- Platform needs to parse the data
- Data MAY affect operational behavior
- Data represents platform-specific configuration
- Data should persist across operations
Use context when:
- Data is only for caller’s internal use
- Data should never affect agent behavior
- Data is for correlation/tracking only
- Data needs to be echoed unchanged
Best Practices
For A2A
- Let the protocol handle context
- Use contextId for explicit conversation threading
- Trust the session management
For MCP
- Do not copy response
context_idvalues into later tool arguments - Use the MCP transport session, if provided, for ephemeral continuity
- Use
task_idor the task’s resource identifiers for durable work - Ignore a request-body
context_idwhere the selected schema admits it
For Extensions
- Always namespace under vendor keys
- Document your extensions extensively
- Consider proposing standardization for common patterns
For Application Context
- Keep it opaque - don’t structure for agents to parse
- Avoid large payloads - context is echoed in every response
- Use for correlation only - never for operational data