Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.

Update to latest AdCP spec: consistent build_creative and preview_creative - #26

Merged
bokelley merged 3 commits into
mainfrom
bokelley/build-creative-debug
Oct 20, 2025
Merged

Update to latest AdCP spec: consistent build_creative and preview_creative#26
bokelley merged 3 commits into
mainfrom
bokelley/build-creative-debug

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

Updates creative agent to align with the latest AdCP specification, making build_creative and preview_creative consistent in how they handle creative manifests.

Changes

Schema Updates

  • ✅ Updated all schemas from adcontextprotocol.org
  • ✅ Removed 4 deprecated schemas that no longer exist in the spec:
    • promoted-offerings-asset.json
    • creative-library-item.json
    • snippet-type.json
    • standard-formats/asset-types/index.json
  • ✅ Added build-creative-request/response schemas from /media-buy/ endpoint
  • ✅ Regenerated all Pydantic models

API Changes

preview_creative

  • Removed parameters: promoted_offerings, brand_card, asset_filters
  • New approach: These should now be included inside creative_manifest.assets
  • Benefit: Cleaner, more consistent API

build_creative

  • Complete rewrite (500+ lines → 200 lines!)
  • New signature:
    build_creative(
        target_format_id: str | dict,
        creative_manifest: dict | None = None,
        message: str | None = None,
        gemini_api_key: str | None = None
    )
  • Now accepts: creative_manifest with input assets (e.g., promoted_offerings)
  • Returns: creative_manifest in structured_content
  • Benefit: Consistent with preview_creative - both now work with manifests

The Fix

The original issue was an MCP call trying to use build_creative with a creative_manifest parameter, which the old implementation didn't support. Now both tools work consistently:

  1. build_creative: manifest with input assets → manifest with output assets
  2. preview_creative: manifest with output assets → preview URLs

Much more intuitive and spec-compliant! 🎉

Test Plan

  • Syntax validation passes
  • Mypy type checking passes
  • Integration tests (will need updates for new API)

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

bokelley and others added 3 commits October 20, 2025 07:00
…ative

- Updated schemas from adcontextprotocol.org
- Removed deprecated schemas (promoted-offerings-asset, creative-library-item, snippet-type, asset-types index)
- Added build-creative schemas from /media-buy/ endpoint
- Regenerated Pydantic models

Key API changes:
- preview_creative: Removed promoted_offerings, brand_card, asset_filters parameters
  - These should now be included inside creative_manifest.assets
- build_creative: Complete rewrite to match new spec
  - Now takes target_format_id and creative_manifest (with input assets)
  - Returns creative_manifest in structured_content
  - Simpler, more consistent API aligned with preview_creative

The new spec makes both tools consistent: they both accept creative_manifest
as input, making the API more intuitive and easier to use.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The CI check was failing because the schema generation script wasn't
adding the necessary type: ignore comment for the webhook method field.

This fix ensures the generated schemas are deterministic and pass mypy
validation consistently.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
After regenerating schemas, the auto-generated class names changed:
- Assets31 (was UrlAsset) is now VastAsset
- Assets33 is now UrlAsset
- Assets28 is VideoAsset
- Assets32 is TextAsset

Updated all test imports to use the correct asset classes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley
bokelley merged commit d0f77bf into main Oct 20, 2025
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant