OptionalaccountOptionalagentResolved buyer agent for this request, populated by BuyerAgentRegistry
when an agentRegistry is configured on the server (Phase 1 of #1269).
Carries the durable commercial relationship — status, billing
capabilities, default account terms — distinct from the per-request
credential. Undefined when no registry is configured OR when the
registry returned null for the request's credential.
OptionalsessionSession scoping key derived from the request. Populated when resolveSessionKey is configured.
State store for persisting domain objects (media buys, accounts, creatives).
OptionalauthAuthentication info for the caller, when ServeOptions.authenticate is
configured. Populated from the MCP SDK's extra.authInfo, which
serve() sets from the auth principal. Use this to enforce
per-principal authorization in handlers.
Stage 3 of #1269 added the kind-discriminated credential and the
operator fields. The legacy token / clientId / scopes are
preserved as optional fields through the deprecation cycle; new code
should read credential and switch on its kind.
Buyer-agent identity post-resolution is on ctx.agent (the resolved
BuyerAgent record), NOT here — this surface only carries
authentication information about the credential, not the registry
lookup result.
OptionalemitEmit a signed webhook to a buyer's push_notification_config.url.
Populated when AdcpServerConfig.webhooks is configured. Handles
RFC 9421 signing, stable idempotency_key across retries, and
retry/backoff per adcp#2417 + adcp#2423 + adcp#2478.
Typical call from inside a completion handler:
await ctx.emitWebhook({
url: push_notification_config.url,
payload: { task: { task_id, status: 'completed', result } },
operation_id: `create_media_buy.${media_buy_id}`,
});
Context passed to every handler.
If the tool has an account ref and
resolveAccountis configured,accountis the resolved account object (guaranteed non-null — the handler only runs if resolution succeeds).If
resolveSessionKeyis configured,sessionKeyis the scoping key derived from the request — usually tenant/brand/publisher-account id. Handlers can pass it toscopedStore(ctx.store, ctx.sessionKey!)to get a session-scoped view that works on anyAdcpStateStoreimplementation.