Skip to main content

A2B: Testing your first agent call

Free module — No account required. ~20 minutes with Addie. Prerequisite: A2.

Learning objectives

  • Initialize a stateful MCP session against the AdCP test agent
  • Call get_products with a natural-language brief and read the product response
  • Place a media buy with create_media_buy and handle all three response shapes
  • Attach creatives with sync_creatives and check buy status via get_media_buys
  • Diagnose and resolve auth failures, schema mismatches, and async polling delays

Reading list

AdCP quickstart

End-to-end buyer workflow from setup to delivery.

Media buy lifecycle

Media buy status states — pending_creatives, pending_start, active, paused, completed — and what each means for the buyer.

Create media buy task

Full field reference, required fields, and all three response shapes.

Sync creatives task

How to attach assets to a buy, dry-run validation, and assignment patterns.

Error handling

Error codes, retry behavior, and how to read the errors[] array.

MCP integration guide

Session initialization, the mcp-session-id header, and tool call format.

Test agent

All curl examples below target the AdCP training agent:
You’ll need an API key from your AgenticAdvertising.org dashboard. Replace <your-api-key> in every example.

What you’ll do with Addie

Walk through five calls in sequence. Addie demonstrates each call, shows the raw response, then guides you through reproducing it yourself.
  1. Initialize — open a stateful MCP session; save the mcp-session-id header
  2. Discoverget_products with a brief; read proposals
  3. Buycreate_media_buy; handle all three response shapes
  4. Attach creativessync_creatives; validate with dry-run first
  5. Poll statusget_media_buys until valid_actions shows the buy is serving

Step-by-step curl reference

Use these as a quick reference while working through the module with Addie, or to reproduce any step independently.

Step 1 — Initialize a session

Every sequence starts with an initialize call. The response sets the protocol version and returns an mcp-session-id header — save it.
The response includes an mcp-session-id in the response headers. Every subsequent call must include it:

Step 2 — Discover products

Call get_products with buying_mode: "brief" and a plain-English description of your campaign goals. The agent returns curated products[] and ready-to-execute proposals[].
The result is in content[0].text as JSON. Look for proposals[0].proposal_id — you’ll pass it to create_media_buy.

Step 3 — Place a media buy

Pass the proposal_id from Step 2 and a total_budget. The idempotency_key lets you safely retry if the network drops — use a fresh UUID v4 per request.
Three response shapes — you’ll see one of these:

Step 4 — Attach creatives

A buy in pending_creatives state can’t serve until you call sync_creatives. Use dry_run: true first to validate your creative shapes without writing anything.
Remove "dry_run": true to apply. The response includes creatives[].statusapproved, pending_review, or rejected.

Step 5 — Check status

Poll get_media_buys with the media_buy_id from Step 3 to see lifecycle state and valid_actions.
The media_buys[0].status field is one of pending_creatives, pending_start, active, paused, completed, rejected, or canceled. The valid_actions array tells you what the buyer can do next.

Async polling

When create_media_buy returns status: "submitted" and a task_id, the buy is queued. Poll until the task completes:
get_task_status is an AdCP application-layer task polling tool. In 3.x, sellers that do not advertise this alias still expose the legacy AdCP tasks/get surface with the same snake_case payload. Do not confuse either AdCP polling surface with transport-native MCP/A2A tasks/* methods, which use their own task wire shapes.
Poll every 2–5 seconds. When the AdCP task status is completed, the result field contains the full create_media_buy response with media_buy_id. See the Task lifecycle doc for all AdCP task status values.

Common errors

Assessment

Passing threshold: 70%.

Start this module

Start A2B with Addie

Open Addie and say “I’d like to start certification module A2B.”
Next: A3: The AdCP landscape