Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/media-buy/advanced-topics/orchestrator-design.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,9 @@ class AdCPOrchestrator:
}
}]
},
"push_notification_config": webhook_config
"configuration": {
"pushNotificationConfig": webhook_config
}
})

# 4. Handle response with unified status handling
Expand Down
75 changes: 46 additions & 29 deletions docs/media-buy/task-reference/create_media_buy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ data: {"message": "Validating packages..."}
data: {"message": "Checking inventory availability..."}
data: {"message": "Creating campaign in ad server..."}
data: {"status": {"state": "completed"}, "artifacts": [{
"artifactId": "artifact-mb-conf-abc123",
"name": "media_buy_confirmation",
"parts": [
{"kind": "text", "text": "Successfully created $100,000 media buy. Upload creatives by Jan 30."},
Expand All @@ -390,7 +391,7 @@ data: {"status": {"state": "completed"}, "artifacts": [{
- **A2A**: Always returns task with updates via:
- Server-Sent Events (SSE) for real-time streaming
- Webhooks (push notifications) for long-running tasks
- **Payload**: The `input` field in A2A contains the exact same structure as MCP's `arguments`
- **Payload**: The `parameters` field in A2A contains the exact same structure as MCP's `arguments`

## Human-in-the-Loop Examples

Expand Down Expand Up @@ -466,17 +467,24 @@ A2A can use Server-Sent Events for real-time streaming or webhooks for push noti
**Initial Request with SSE:**
```json
{
"skill": "create_media_buy",
"input": {
"buyer_ref": "large_campaign_2024",
"packages": [...],
"brand_manifest": {
"name": "ACME Corporation",
"url": "https://acmecorp.com"
},
"po_number": "PO-2024-LARGE-001",
"start_time": "2024-02-01T00:00:00Z",
"end_time": "2024-06-30T23:59:59Z"
"message": {
"parts": [{
"kind": "data",
"data": {
"skill": "create_media_buy",
"parameters": {
"buyer_ref": "large_campaign_2024",
"packages": [...],
"brand_manifest": {
"name": "ACME Corporation",
"url": "https://acmecorp.com"
},
"po_number": "PO-2024-LARGE-001",
"start_time": "2024-02-01T00:00:00Z",
"end_time": "2024-06-30T23:59:59Z"
}
}
}]
}
}
```
Expand All @@ -501,7 +509,7 @@ data: {"message": "Sales team notified. Expected review time: 2-4 hours"}
data: {"message": "First approval received from regional manager"}
data: {"message": "Second approval received from finance team"}
data: {"status": {"state": "completed"}, "artifacts": [{
"artifactId": "artifact-mb-large-xyz",
"artifactId": "artifact-mb-approval-xyz789",
"name": "media_buy_confirmation",
"parts": [
{"kind": "text", "text": "Media buy approved and created successfully. $500,000 campaign scheduled Feb 1 - Jun 30. Upload creatives by Jan 30."},
Expand All @@ -520,22 +528,31 @@ data: {"status": {"state": "completed"}, "artifacts": [{
**Initial Request with Webhook Configuration:**
```json
{
"skill": "create_media_buy",
"input": {
"buyer_ref": "large_campaign_2024",
"packages": [...],
"brand_manifest": {
"name": "ACME Corporation",
"url": "https://acmecorp.com"
},
"po_number": "PO-2024-LARGE-001",
"start_time": "2024-02-01T00:00:00Z",
"end_time": "2024-06-30T23:59:59Z"
"message": {
"parts": [{
"kind": "data",
"data": {
"skill": "create_media_buy",
"parameters": {
"buyer_ref": "large_campaign_2024",
"packages": [...],
"brand_manifest": {
"name": "ACME Corporation",
"url": "https://acmecorp.com"
},
"po_number": "PO-2024-LARGE-001",
"start_time": "2024-02-01T00:00:00Z",
"end_time": "2024-06-30T23:59:59Z"
}
}
}]
},
"pushNotificationConfig": {
"url": "https://buyer.example.com/webhooks/adcp",
"authType": "bearer",
"authToken": "secret-token-xyz"
"configuration": {
"pushNotificationConfig": {
"url": "https://buyer.example.com/webhooks/adcp",
"authType": "bearer",
"authToken": "secret-token-xyz"
}
}
}
```
Expand Down Expand Up @@ -568,7 +585,7 @@ data: {"status": {"state": "completed"}, "artifacts": [{
"contextId": "ctx-conversation-xyz",
"status": {"state": "completed"},
"artifacts": [{
"artifactId": "artifact-mb-webhook-xyz",
"artifactId": "artifact-mb-webhook-def456",
"name": "media_buy_confirmation",
"parts": [
{"kind": "data", "data": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,15 @@ A2A returns results as artifacts:
```json
{
"artifacts": [{
"artifactId": "artifact-perf-feedback-abc789",
"name": "performance_feedback_confirmation",
"parts": [
{
"kind": "text",
"text": "Performance feedback received for campaign gam_1234567890. The 35% above-expected conversion rate will be used to optimize future delivery. Next optimization cycle runs tonight at midnight UTC."
},
{
"kind": "data",
"kind": "data",
"data": {
"success": true
}
Expand Down
28 changes: 18 additions & 10 deletions docs/protocols/a2a-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,15 @@ const task = await a2a.send({
"taskId": "task-123", // A2A task identifier
"contextId": "ctx-456", // Automatic context management
"artifacts": [{ // A2A-specific artifact structure
"artifactId": "artifact-product-catalog-abc",
"name": "product_catalog",
"parts": [
{
"kind": "text",
"text": "Found 12 video products perfect for pet food campaigns"
},
{
"kind": "data",
"kind": "data",
"data": {
"products": [...],
"total": 12
Expand All @@ -186,15 +187,22 @@ const task = await a2a.send({
### Processing Artifacts
```javascript
function processA2aResponse(response) {
// Extract human message
const message = response.artifacts?.[0]?.parts
?.find(p => p.kind === 'text')?.text;

// Extract structured data
const data = response.artifacts?.[0]?.parts
?.find(p => p.kind === 'data')?.data;

return { message, data, status: response.status };
// Extract the artifact (currently AdCP returns single artifact per response)
const artifact = response.artifacts?.[0];

if (artifact) {
const message = artifact.parts?.find(p => p.kind === 'text')?.text;
const data = artifact.parts?.find(p => p.kind === 'data')?.data;

return {
artifactId: artifact.artifactId,
message,
data,
status: response.status
};
}

return { status: response.status };
}
```

Expand Down
2 changes: 2 additions & 0 deletions docs/protocols/envelope-examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ MCP sends progress notifications separately:
"state": "completed",
"artifacts": [
{
"artifactId": "artifact-get-products-abc123",
"name": "get_products_result",
"content_type": "application/json",
"content": "{\"products\": [...]}"
Expand Down Expand Up @@ -155,6 +156,7 @@ Later, webhook notification:
"state": "completed",
"artifacts": [
{
"artifactId": "artifact-media-buy-webhook-def456",
"name": "create_media_buy_result",
"content_type": "application/json",
"content": "{\"media_buy_id\": \"mb_789\", ...}"
Expand Down
1 change: 1 addition & 0 deletions docs/protocols/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ Both protocols support all features - they just express them differently:
{
"contextId": "ctx-123",
"artifacts": [{
"artifactId": "artifact-product-catalog-xyz123",
"name": "product_catalog",
"parts": [
{"kind": "text", "text": "Found 5 CTV products"},
Expand Down
3 changes: 2 additions & 1 deletion docs/protocols/protocol-comparison.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ Same status and data, different packaging:
"status": "input-required",
"contextId": "ctx-123",
"artifacts": [{
"artifactId": "artifact-product-discovery-xyz",
"name": "product_discovery",
"parts": [
{
"kind": "text",
"kind": "text",
"text": "I need your budget and target audience"
},
{
Expand Down
1 change: 1 addition & 0 deletions docs/signals/tasks/activate_signal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ data: {"message": "Validating signal access permissions..."}
data: {"message": "Configuring deployment on The Trade Desk..."}
data: {"message": "Finalizing activation..."}
data: {"status": {"state": "completed"}, "artifacts": [{
"artifactId": "artifact-signal-activation-abc123",
"name": "signal_activation_result",
"parts": [
{"kind": "text", "text": "Signal successfully activated on The Trade Desk"},
Expand Down
1 change: 1 addition & 0 deletions docs/signals/tasks/get_signals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ A2A returns results as artifacts with the same data structure:
```json
{
"artifacts": [{
"artifactId": "artifact-signal-discovery-def456",
"name": "signal_discovery_result",
"parts": [
{
Expand Down
Loading