Skip to content
AdCrunch
Esc
↑↓navigate↵open⌘Jpreview
On this page

library_variation_update

Set or clear the Placement of a Variation. The Asset of the Variation never changes.

Ask to say which slot a cut is for. The agent sets the Placement of a Variation, or clears it.

“The square banner is for the Meta Feed.”

The agent reads the Creative with library_creative_get, finds the Placement with library_placement_list, and calls this tool. The kind of the Asset must be the type of the Placement. A rule that the Asset breaks never blocks the call: the answer lists it as a broken rule, and the agent tells you. The agent names a Placement only when you say which slot the cut is for. No ad account changes.

This tool is part of the job Bring your own creative.

Reference

Set the Placement of a Variation of a Creative of your Library, or clear it. placement_id is required: a Placement id sets it, and null clears it. The Placement is the slot where a provider shows an ad. The Asset of a Variation never changes. Only its Placement changes, with library_variation_update. To use another Asset in the Creative, remove the Variation with library_variation_remove and add a new one with library_variation_add. One Asset can be in two Variations of a Creative when their Placements differ. Name a Placement on a Variation only when the user says which slot the cut is for. Never set one because the Asset fits the rules. The kind of the Asset must be the type of the Placement. A rule that the Asset breaks never blocks the call: the answer lists it in brokenRules. Read brokenRules of a Variation before you build an ad with it. A broken rule is advice: tell the user, and do not refuse. unknownRules lists the rules that need a fact that the Asset lacks, such as the width of a file that AdCrunch could not read. This changes no ad account.

Input

Argument Type Required Description
creative_id string yes The id of a Creative of your Library (crv_…). library_creative_list gives it.
placement_id string or null yes The id of the Placement (plm_…) that the cut is for, or null to clear it. library_placement_list gives the ids. Send a Placement only when the user says which slot the cut is for.
variation_id string yes The id of a Variation of that Creative (var_…). library_variation_list gives it.

Output

A successful call returns this object in structuredContent.

Field Type Always present Description
variation object yes The Variation with its new Placement, and its brokenRules and unknownRules for that Placement.
variation.asset object yes
variation.asset.contentHash string yes AdCrunch’s own hash of the stored bytes. A hint for de-duplication, never an identity, and never a provider’s hash. Empty when the store reports none.
variation.asset.createdAt number yes Milliseconds since the Unix epoch, UTC.
variation.asset.createdBy string yes The user who reserved the upload.
variation.asset.deletedAt number or null yes Always null here. A deleted Asset is not answered.
variation.asset.durationMs number or null yes How long the video runs, in milliseconds, read from the header of the file at finalize. null for an image. For a video, null when the file does not state it, or for an Asset uploaded before AdCrunch read it.
variation.asset.failureCode string or null yes Why AdCrunch refused the file, as a code. Branch on this field, never on failureReason. unsupported_type: the bytes are not an accepted image or video. too_large: the file is over the size limit. unreadable: AdCrunch could not read the header of the file. source_unreachable: an import could not fetch the file from its source URL. source_length_unknown: the source of an import sent no Content-Length. null unless status is failed.
variation.asset.failureReason string or null yes Why AdCrunch refused the file, as a sentence. null unless status is failed.
variation.asset.filename string yes The name the file was uploaded under. Never a lookup key.
variation.asset.height number or null yes The height in pixels as the file is displayed, with its rotation applied, read from the header of the file at finalize. null when the file does not state it, or for an Asset uploaded before AdCrunch read it.
variation.asset.id string yes The id of the Asset, ast_….
variation.asset.key string yes Where the bytes are held. Read-only, and never sent by you.
variation.asset.kind one of image, video yes Follows from mimeType. It selects how a provider takes the file.
variation.asset.mimeType string yes The type that finalize identified from the stored bytes. The Content-Type of the upload does not set it.
variation.asset.name string or null yes The name a person gave this Asset, and what a provider receives at a future registration. null until somebody renames it, and the filename is the fallback.
variation.asset.organizationId string yes The organization that owns the Asset.
variation.asset.sizeBytes number yes Read from the stored object at finalize.
variation.asset.status one of pending, ready, failed yes ready once AdCrunch has inspected the bytes. Only a ready Asset can be registered. pending: the bytes have not been inspected yet. failed: AdCrunch refused the file and deleted it. failureCode and failureReason say why. A read answers an Asset in every status. A list answers ready Assets only.
variation.asset.updatedAt number or null yes When the Asset last changed, in milliseconds since the Unix epoch, UTC: at finalize, or at the last rename.
variation.asset.width number or null yes The width in pixels as the file is displayed, with its rotation applied, read from the header of the file at finalize. null when the file does not state it, or for an Asset uploaded before AdCrunch read it.
variation.assetId string yes The id of the Asset that the Variation holds, ast_…. asset is that Asset. Its width, height and durationMs give the dimensions of the Variation.
variation.brokenRules array of object yes The rules of the Placement that the Asset breaks, as the Placement stores them. They are advice: AdCrunch wrote the Variation anyway. Empty when placement is null. AdCrunch computes this list at each read, so a change of the rules of the Placement changes the next read.
variation.brokenRules[].type width or height or size or ratio or mime or duration yes
variation.brokenRules[].operator object yes Only when type is width.
variation.brokenRules[].operator.condition eq or ne or lt or lte or gt or gte or in yes
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is eq.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is ne.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is lt.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is lte.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is gt.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is gte.
variation.brokenRules[].operator.value array of (integer, at least 0), 1 to 50 items yes Only when condition is in.
variation.brokenRules[].operator object yes Only when type is height.
variation.brokenRules[].operator.condition eq or ne or lt or lte or gt or gte or in yes
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is eq.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is ne.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is lt.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is lte.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is gt.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is gte.
variation.brokenRules[].operator.value array of (integer, at least 0), 1 to 50 items yes Only when condition is in.
variation.brokenRules[].operator object yes Only when type is size.
variation.brokenRules[].operator.condition eq or ne or lt or lte or gt or gte or in yes
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is eq.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is ne.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is lt.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is lte.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is gt.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is gte.
variation.brokenRules[].operator.value array of (integer, at least 0), 1 to 50 items yes Only when condition is in.
variation.brokenRules[].operator object yes Only when type is ratio.
variation.brokenRules[].operator.condition eq or ne or lt or lte or gt or gte or in yes
variation.brokenRules[].operator.value array of any, 2 items yes Only when condition is eq.
variation.brokenRules[].operator.value array of any, 2 items yes Only when condition is ne.
variation.brokenRules[].operator.value array of any, 2 items yes Only when condition is lt.
variation.brokenRules[].operator.value array of any, 2 items yes Only when condition is lte.
variation.brokenRules[].operator.value array of any, 2 items yes Only when condition is gt.
variation.brokenRules[].operator.value array of any, 2 items yes Only when condition is gte.
variation.brokenRules[].operator.value array of (array of any, 2 items), 1 to 50 items yes Only when condition is in.
variation.brokenRules[].operator object yes Only when type is mime.
variation.brokenRules[].operator.condition eq or ne or in yes
variation.brokenRules[].operator.value string, 1 to 255 characters yes Only when condition is eq.
variation.brokenRules[].operator.value string, 1 to 255 characters yes Only when condition is ne.
variation.brokenRules[].operator.value array of (string, 1 to 255 characters), 1 to 50 items yes Only when condition is in.
variation.brokenRules[].operator object yes Only when type is duration.
variation.brokenRules[].operator.condition eq or ne or lt or lte or gt or gte or in yes
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is eq.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is ne.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is lt.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is lte.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is gt.
variation.brokenRules[].operator.value integer, at least 0 yes Only when condition is gte.
variation.brokenRules[].operator.value array of (integer, at least 0), 1 to 50 items yes Only when condition is in.
variation.createdAt number yes Milliseconds since the Unix epoch, UTC.
variation.createdBy string yes The user who added the Variation.
variation.creativeId string yes The Creative that the Variation belongs to, crv_….
variation.deletedAt number or null yes Always null here. A removed Variation is not answered.
variation.id string yes The id of the Variation, var_….
variation.organizationId string yes The organization that owns the Creative.
variation.placement object or null yes The Placement that the Variation names, or null. null also when the Placement was deleted after the Variation named it.
variation.placement.channel one of meta, tiktok, snapchat, google_search, google_pmax, google_display, youtube, programmatic_display, linkedin, x yes The channel of a Line Item that the Placement belongs to.
variation.placement.id string yes The id of the Placement, plm_….
variation.placement.name string yes The name of the Placement.
variation.placement.type one of image, video yes The kind of Asset that the Placement takes.
variation.placementId string or null yes The id of the Placement that the Variation names, plm_…, or null when it names none.
variation.unknownRules array of object yes The rules of the Placement that need a fact that the Asset does not have: a width, a height, a duration or a ratio of an Asset that AdCrunch could not read. They are neither held nor broken. Empty when placement is null. AdCrunch computes this list at each read.
variation.unknownRules[].type width or height or size or ratio or mime or duration yes
variation.unknownRules[].operator object yes Only when type is width.
variation.unknownRules[].operator.condition eq or ne or lt or lte or gt or gte or in yes
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is eq.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is ne.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is lt.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is lte.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is gt.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is gte.
variation.unknownRules[].operator.value array of (integer, at least 0), 1 to 50 items yes Only when condition is in.
variation.unknownRules[].operator object yes Only when type is height.
variation.unknownRules[].operator.condition eq or ne or lt or lte or gt or gte or in yes
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is eq.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is ne.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is lt.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is lte.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is gt.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is gte.
variation.unknownRules[].operator.value array of (integer, at least 0), 1 to 50 items yes Only when condition is in.
variation.unknownRules[].operator object yes Only when type is size.
variation.unknownRules[].operator.condition eq or ne or lt or lte or gt or gte or in yes
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is eq.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is ne.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is lt.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is lte.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is gt.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is gte.
variation.unknownRules[].operator.value array of (integer, at least 0), 1 to 50 items yes Only when condition is in.
variation.unknownRules[].operator object yes Only when type is ratio.
variation.unknownRules[].operator.condition eq or ne or lt or lte or gt or gte or in yes
variation.unknownRules[].operator.value array of any, 2 items yes Only when condition is eq.
variation.unknownRules[].operator.value array of any, 2 items yes Only when condition is ne.
variation.unknownRules[].operator.value array of any, 2 items yes Only when condition is lt.
variation.unknownRules[].operator.value array of any, 2 items yes Only when condition is lte.
variation.unknownRules[].operator.value array of any, 2 items yes Only when condition is gt.
variation.unknownRules[].operator.value array of any, 2 items yes Only when condition is gte.
variation.unknownRules[].operator.value array of (array of any, 2 items), 1 to 50 items yes Only when condition is in.
variation.unknownRules[].operator object yes Only when type is mime.
variation.unknownRules[].operator.condition eq or ne or in yes
variation.unknownRules[].operator.value string, 1 to 255 characters yes Only when condition is eq.
variation.unknownRules[].operator.value string, 1 to 255 characters yes Only when condition is ne.
variation.unknownRules[].operator.value array of (string, 1 to 255 characters), 1 to 50 items yes Only when condition is in.
variation.unknownRules[].operator object yes Only when type is duration.
variation.unknownRules[].operator.condition eq or ne or lt or lte or gt or gte or in yes
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is eq.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is ne.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is lt.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is lte.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is gt.
variation.unknownRules[].operator.value integer, at least 0 yes Only when condition is gte.
variation.unknownRules[].operator.value array of (integer, at least 0), 1 to 50 items yes Only when condition is in.
variation.updatedAt number or null yes When the Placement of the Variation last changed, or null when it never did. Only the Placement changes: the Asset of a Variation never changes.

Failure codes

A failed call has isError set, and structuredContent.error holds one of these codes. Errors describes the shape of a failed call.

  • not_found
  • placement_type_mismatch
  • variation_exists
  • organization_unentitled
  • forbidden
  • invalid_request
  • internal_error

Scope

The token must hold library:write. Auth & scopes lists each scope.

Annotations

A client reads these hints. A hint that the tool does not declare has the default value of the MCP specification.

  • Writes. The tool can change data.
  • Not destructive. The tool makes only additive changes.
  • Idempotent. A second call with the same arguments changes nothing more.
  • Closed world. The tool reads and writes the data of AdCrunch only.

Example

The arguments:

{
  "creative_id": "crv_5e2a19",
  "placement_id": "plm_meta_stories_video",
  "variation_id": "var_8c3f60"
}

The result, in structuredContent:

{
  "variation": {
    "asset": {
      "contentHash": "9d2f41b7c6e8a35014f7b2d9c3e6a810",
      "createdAt": 1790000000000,
      "createdBy": "usr_2e5b84",
      "deletedAt": null,
      "durationMs": 15000,
      "failureCode": null,
      "failureReason": null,
      "filename": "spring-sale.mp4",
      "height": 1920,
      "id": "ast_7c1e9a",
      "key": "org_3a7f10/ast_7c1e9a",
      "kind": "video",
      "mimeType": "video/mp4",
      "name": "Spring sale 9:16",
      "organizationId": "org_3a7f10",
      "sizeBytes": 24117248,
      "status": "ready",
      "updatedAt": 1790000120000,
      "width": 1080
    },
    "assetId": "ast_7c1e9a",
    "brokenRules": [],
    "createdAt": 1790000360000,
    "createdBy": "usr_2e5b84",
    "creativeId": "crv_5e2a19",
    "deletedAt": null,
    "id": "var_8c3f60",
    "organizationId": "org_3a7f10",
    "placement": {
      "channel": "meta",
      "id": "plm_meta_stories_video",
      "name": "Meta Stories video",
      "type": "video"
    },
    "placementId": "plm_meta_stories_video",
    "unknownRules": [],
    "updatedAt": 1790000900000
  }
}

Was this page helpful?