Skip to content

feat: error translation helper for multi-transport servers #176

@bokelley

Description

@bokelley

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions