# x_ads_upload_media

> Upload an image, GIF or MP4 clip to X. A write tool that previews before it changes anything, one of 44 X Ads tools on the Get MCP Ads MCP gateway.

[Documentation](https://www.getmcpads.com/docs) / [Sources](https://www.getmcpads.com/docs/sources) / [X Ads](https://www.getmcpads.com/docs/sources/x-ads)

Upload an image, GIF or MP4 clip to X. Preview includes size and SHA-256 only. X API credits may be charged. Images use one request; video/GIF use initialize, append and finalize without retries. Check processing before registering the returned media_key with create_media_library_item. Does not create or activate an ad.

> **Note** Connect your own X Ads account and select the advertisers to expose. Free permits reads; Pro, Team and Agency permit writes. Reconnect older connections for media.write. X controls account verification and delivery eligibility.

> **Warning** This tool changes the account. It is absent from the tool list on the Free plan, and it previews by default: without `confirm: true` it describes the change and applies nothing.

|  |  |
| --- | --- |
| Source | [X Ads](https://www.getmcpads.com/docs/sources/x-ads) |
| Kind | Write |
| Discovery | Reachable through `search_tools` and `run_tool` |
| Account parameter | `account_id` |
| Endpoint | https://mcp.getmcpads.com/x-ads/mcp |

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `account_id` | string | Required | X Ads account selected in Sources. Register the resulting media in this account's media library. |
| `media_base64` | string | Required | File bytes as base64, without a data URL prefix. Maximum 4 MB per file, including MP4 clips. No URL fetching. |
| `media_type` | string | Required | MIME type matching the actual uploaded file bytes. One of: `image/png`, `image/jpeg`, `image/gif`, `video/mp4`. |
| `confirm` | boolean | Optional | False previews only; true uploads after human confirmation, potentially charging X developer API credits. Default: `false`. |

## Calling it

Through run_tool, since it is not announced

```json
{
  "name": "run_tool",
  "arguments": {
    "name": "x_ads_upload_media",
    "args": {
      "account_id": "<string>",
      "media_base64": "<string>",
      "media_type": "image/png"
    }
  }
}
```

- [X Ads metrics](https://www.getmcpads.com/docs/sources/x-ads/metrics): What you can ask for.
- [X Ads dimensions](https://www.getmcpads.com/docs/sources/x-ads/dimensions): How you can break it down.

---

This page as HTML: https://www.getmcpads.com/docs/sources/x-ads/tools/x_ads_upload_media
Every page under /docs is available as Markdown: append `.md`, or send `Accept: text/markdown`.
