asset_finalize
Complete an upload after the bytes have been PUT, validate the file, and add the Asset to your library — optionally registering it in the same call.
Completes an upload after the bytes have been PUT to the URL from asset_create_upload, and adds the Asset to your library. The file is validated here — nothing about it is known until it lands — so a wrong type or an oversized file is rejected at this step.
Input
| Field | Type | Required | Description |
|---|---|---|---|
asset_id |
ast_* |
yes | The Asset id returned by asset_create_upload. |
advertiser_id |
acc_* |
no | Register the Asset to this advertiser in the same call. |
Output
{ asset, registration? }:
asset— the finalized Asset (nowstatus: 'ready'), shaped like anasset_listrow.registration— present only whenadvertiser_idwas given: the outcome of the inline registration.
Example
“Finalize that upload and register it to the Acme account.”
Claude calls asset_finalize({ asset_id: 'ast_…', advertiser_id: 'acc_…' }), then polls asset_get until the Registration is ready.
Errors
Finalizing refuses a file it can’t turn into a usable Asset:
not_uploaded— the bytes haven’t arrived.PUTthem to theuploadUrlfirst, then call again.too_large— larger than the provider accepts. The file is discarded; upload a smaller version.unsupported_type— not usable in ads. Discarded; use JPEG, PNG, WebP, GIF, or MP4.type_mismatch— the bytes are a different type from theContent-Typethey were uploaded with. Discarded; upload again with the real type.unreadable— the bytes are no accepted type, or the file ends before its header does. Discarded; upload an intact file of an accepted type.not_found— no such Asset in this organization.401or403— see Errors, which every tool shares. This one needsasset:write.
Reference
Complete an upload after the bytes have been PUT, and add the Asset to the library.
The file is checked here rather than earlier — nothing about it is known until it arrives — so this is where a wrong type or an oversized file is rejected.
Input
| Argument | Type | Required | Description |
|---|---|---|---|
advertiser_id |
string | no | Optionally register the Asset to this advertiser (acc_…) in the same call. |
asset_id |
string | yes | The Asset id returned by asset_create_upload. |
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_foundnot_uploadedtoo_largetype_mismatchunreadableunsupported_typeforbiddeninvalid_requestinternal_error
Scope
The token must hold asset: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.
- Destructive. The tool can make a change that you cannot undo. A client can ask you to confirm before it calls the tool.
- Idempotent. A second call with the same arguments changes nothing more.
- Closed world. The tool reads and writes the data of AdCrunch only.