Skip to content

Commit 3eec3fb

Browse files
authored
Merge pull request #62 from IABTechLab/docs/buyer-docs-improvement
Docs: Streamline buyer website for clarity and storytelling
2 parents 271255c + f3f4370 commit 3eec3fb

29 files changed

Lines changed: 524 additions & 957 deletions

docs/api/a2a-client.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
The buyer agent uses the **Agent-to-Agent (A2A) protocol** for conversational discovery and negotiation with seller agents. A2A sends natural language messages over JSON-RPC 2.0; the seller's AI interprets the request and executes the appropriate tools.
44

5+
## When to Use A2A
6+
7+
| Scenario | A2A | MCP |
8+
|----------|-----|-----|
9+
| Exploratory discovery queries | Preferred | -- |
10+
| Complex negotiations with context | Preferred | -- |
11+
| Ambiguous or open-ended requests | Preferred | -- |
12+
| Automated booking workflows | -- | Preferred |
13+
| Deterministic, repeatable results | -- | Preferred |
14+
15+
Use A2A when the request benefits from natural language interpretation --- for example, asking "What CTV inventory do you have under $25 with household targeting?" rather than constructing exact filter parameters. For structured, deterministic operations, see the [MCP Client](mcp-client.md).
16+
517
## A2AClient Class
618

719
The `A2AClient` connects to a seller's A2A endpoint and sends natural language messages.
@@ -239,18 +251,6 @@ async with A2AClient(base_url="http://seller:8001") as client:
239251
)
240252
```
241253

242-
## When to Use A2A
243-
244-
| Scenario | A2A | MCP |
245-
|----------|-----|-----|
246-
| Exploratory discovery queries | Preferred | -- |
247-
| Complex negotiations with context | Preferred | -- |
248-
| Ambiguous or open-ended requests | Preferred | -- |
249-
| Automated booking workflows | -- | Preferred |
250-
| Deterministic, repeatable results | -- | Preferred |
251-
252-
Use A2A when the request benefits from natural language interpretation --- for example, asking "What CTV inventory do you have under $25 with household targeting?" rather than constructing exact filter parameters.
253-
254254
## Error Handling
255255

256256
The client raises `A2AError` when the seller returns a JSON-RPC error response. HTTP-level errors (connection refused, timeouts) raise standard `httpx` exceptions.

docs/api/bookings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Bookings API
22

3+
A **booking** is the buyer agent's end-to-end process of turning a campaign brief into confirmed advertising deals. You submit a brief describing your campaign objectives, budget, audience, and timeline; the buyer agent allocates budget across channels, researches inventory from connected sellers, optionally negotiates pricing, and presents recommendations for your approval. Once approved, the agent books confirmed line items via the seller's OpenDirect API. Use these endpoints to start a booking, poll its progress, and approve or reject the resulting recommendations.
4+
35
The bookings endpoints manage the full campaign booking lifecycle --- from brief submission through approval to deal execution.
46

57
## Status Lifecycle

docs/api/change-requests.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
Change requests allow the buyer to propose post-deal modifications to orders on the seller. Each request is validated against the current order state, assigned a severity level, and routed through the appropriate approval path on the seller side.
44

5-
!!! info "Planned client"
6-
The buyer does not yet have a dedicated `ChangeRequestsClient`. The workflows below document the seller's REST API that the buyer calls directly. A typed client is planned for a future release.
7-
85
!!! tip "Seller-side reference"
96
For the full server-side behavior --- including severity auto-classification, validation rules, and the review/apply workflow --- see the [Seller Change Requests docs](https://iabtechlab.github.io/seller-agent/api/change-requests/).
107

@@ -33,6 +30,9 @@ sequenceDiagram
3330

3431
The buyer submits a change request and receives a change request ID. Minor changes (e.g., small flight date shifts, creative swaps) are auto-approved and applied immediately. Material and critical changes enter a review queue on the seller side.
3532

33+
!!! info "Planned client"
34+
The buyer does not yet have a dedicated `ChangeRequestsClient`. The workflows below document the seller's REST API that the buyer calls directly. A typed client is planned for a future release.
35+
3636
---
3737

3838
## Severity Levels

docs/api/mcp-client.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
The buyer agent uses the **Model Context Protocol (MCP)** as its primary protocol for calling seller agent tools. MCP provides deterministic, structured tool execution over HTTP --- ideal for automated workflows where the buyer knows exactly which operation to perform.
44

5+
## When to Use MCP
6+
7+
| Scenario | MCP | A2A |
8+
|----------|-----|-----|
9+
| Automated booking workflows | Preferred | -- |
10+
| Structured CRUD operations | Preferred | -- |
11+
| Deterministic, repeatable results | Preferred | -- |
12+
| Exploratory discovery | -- | Preferred |
13+
| Complex multi-turn negotiation | -- | Preferred |
14+
15+
Use MCP when you know the exact tool and arguments. The buyer's CrewAI tools default to MCP for all standard operations. For open-ended discovery and negotiation, see the [A2A Client](a2a-client.md).
16+
17+
!!! note "Automatic protocol selection"
18+
The `UnifiedClient` selects MCP by default for standard operations. You do not need to choose the protocol manually unless you have a specific reason to prefer A2A.
19+
520
## Client Implementations
621

722
The buyer includes two MCP client implementations, selected based on environment and dependency availability.
@@ -97,18 +112,6 @@ async with IABMCPClient(base_url="http://seller:8001") as client:
97112
)
98113
```
99114

100-
## When to Use MCP
101-
102-
| Scenario | MCP | A2A |
103-
|----------|-----|-----|
104-
| Automated booking workflows | Preferred | -- |
105-
| Structured CRUD operations | Preferred | -- |
106-
| Deterministic, repeatable results | Preferred | -- |
107-
| Exploratory discovery | -- | Preferred |
108-
| Complex multi-turn negotiation | -- | Preferred |
109-
110-
Use MCP when you know the exact tool and arguments. The buyer's CrewAI tools default to MCP for all standard operations.
111-
112115
## Error Handling
113116

114117
MCP client errors fall into two categories: connection-level failures (cannot reach the seller) and tool-level failures (the tool call itself failed).

docs/api/media-kit.md

Lines changed: 10 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# Media Kit Discovery
1+
# Media Kit API Reference
22

3-
The media kit is a seller's **inventory catalog** — a curated collection of ad packages that buyer agents browse to discover available inventory. The buyer agent includes a dedicated `MediaKitClient` for consuming seller media kits.
3+
The media kit is a seller's **inventory catalog** --- a curated collection of ad packages that buyer agents browse to discover available inventory. The buyer agent includes a dedicated `MediaKitClient` for consuming seller media kits. This page documents the client's methods, parameters, data models, and error handling.
4+
5+
!!! tip "Looking for usage patterns?"
6+
For practical guidance on browsing strategies, progressive identity revelation, cross-seller comparison, and connecting discovery to the buying workflow, see the [Media Kit Browsing Guide](../guides/media-kit.md).
47

58
## Overview
69

@@ -198,38 +201,6 @@ Sellers apply tier-based discounts. Higher identity revelation unlocks better pr
198201
!!! tip "Progressive Identity Revelation"
199202
Start with public browsing to evaluate inventory, then authenticate to see exact pricing. Provide agency/advertiser identity during search to unlock the best rates.
200203

201-
## Identity-Based Access
202-
203-
Beyond the API key, the buyer can reveal its identity for seller-side tier resolution. The `SearchFilter` supports this:
204-
205-
```python
206-
# Search with full identity context
207-
results = await client.search_packages(
208-
seller_url,
209-
query="premium video",
210-
filters=SearchFilter(
211-
buyer_tier="advertiser",
212-
agency_id="omnicom-456",
213-
advertiser_id="coca-cola",
214-
),
215-
)
216-
```
217-
218-
Alternatively, the `BuyerIdentity` model can generate identity headers for direct HTTP calls:
219-
220-
```python
221-
from ad_buyer.models.buyer_identity import BuyerIdentity
222-
223-
identity = BuyerIdentity(
224-
seat_id="ttd-seat-123",
225-
agency_id="omnicom-456",
226-
advertiser_id="coca-cola",
227-
)
228-
229-
# Produces: {"X-DSP-Seat-ID": "...", "X-Agency-ID": "...", "X-Advertiser-ID": "..."}
230-
headers = identity.to_header_dict()
231-
```
232-
233204
## Data Models
234205

235206
### PackageSummary (Public)
@@ -322,31 +293,10 @@ Common error scenarios:
322293
| HTTP 4xx/5xx | `MediaKitError` with status code |
323294
| Failed seller in aggregation | Silently skipped, warning logged |
324295

325-
## Workflow: From Media Kit to Booking
326-
327-
The media kit is the first step in the deal lifecycle:
328-
329-
```mermaid
330-
graph LR
331-
A[Browse Media Kit] --> B[Select Package]
332-
B --> C[Get Exact Pricing]
333-
C --> D[Request Quote]
334-
D --> E[Negotiate]
335-
E --> F[Book Deal]
336-
```
337-
338-
1. **Browse** the seller's media kit (public or authenticated)
339-
2. **Select** a package that matches campaign requirements
340-
3. **Get exact pricing** by authenticating with your API key
341-
4. **Request a quote** via the [OpenDirect](https://iabtechlab.com/standards/opendirect/) API for specific products in the package
342-
5. **Negotiate** if your tier allows it (Agency/Advertiser)
343-
6. **Book** the deal through the standard booking flow
344-
345-
See [Booking Lifecycle](bookings.md) and [Seller Agent Integration](../integration/seller-agent.md) for the full workflow.
346-
347296
## Related
348297

349-
- [Seller Agent Media Kit Setup](https://iabtechlab.github.io/seller-agent/guides/media-kit/) — How publishers configure their media kit
350-
- [Authentication](authentication.md) — API key setup for authenticated access
351-
- [Products](products.md) — Product search endpoint
352-
- [Seller Agent Integration](../integration/seller-agent.md) — Full integration guide
298+
- [Media Kit Browsing Guide](../guides/media-kit.md) --- Practical patterns for browsing, cross-seller comparison, and connecting discovery to the buying workflow
299+
- [Seller Agent Media Kit Setup](https://iabtechlab.github.io/seller-agent/guides/media-kit/) --- How publishers configure their media kit
300+
- [Authentication](authentication.md) --- API key setup for authenticated access
301+
- [Products](products.md) --- Product search endpoint
302+
- [Seller Agent Integration](../integration/seller-agent.md) --- Full integration guide

docs/api/products.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Products API
22

3-
The products endpoint lets you search the seller agent's product catalog directly, outside of a booking workflow.
3+
The products endpoint lets you search the seller agent's product catalog directly, outside of a booking workflow. Use this for quick inventory lookups when you already know what channel, format, or price range you need --- for richer browsing with package metadata, tier-based pricing, and cross-seller comparison, use the [Media Kit API](media-kit.md) instead.
44

55
## POST /products/search
66

0 commit comments

Comments
 (0)