Problem
Servers supporting both MCP and A2A need to translate AdCP errors to each protocol's error format. This translation is currently duplicated in every multi-transport server.
Proposed solution
Add translate_error(exc, protocol) helper:
from adcp.server import translate_error
try:
result = await handler.create_media_buy(params)
except AdCPError as e:
return translate_error(e, protocol="a2a") # or "mcp"
Also: add normalize_request(task_name, params, client_version) for cross-version field renames (account_id → account, campaign_ref → buyer_campaign_ref, etc.).
Ref: prebid/salesagent#1183 review on #174
Problem
Servers supporting both MCP and A2A need to translate AdCP errors to each protocol's error format. This translation is currently duplicated in every multi-transport server.
Proposed solution
Add
translate_error(exc, protocol)helper:Also: add
normalize_request(task_name, params, client_version)for cross-version field renames (account_id → account, campaign_ref → buyer_campaign_ref, etc.).Ref: prebid/salesagent#1183 review on #174