Upload ad media
tg_upload_mediaUpload a local image or video to Telegram Ads and return its media ID for use in ad or website placements. Supports ad_photo, ad_video, and website_photo with defined size limits.
Instructions
Upload a local file to Telegram Ads and return its media ID. Limits: ad_photo JPEG/PNG up to 5 MiB and at least 640px wide; ad_video MP4 up to 20 MiB, 16:9, 3-60 seconds; website_photo JPEG/PNG up to 1 MiB and at least 150x150. Requires confirm: true and TG_ADS_MODE=write.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"kind": "<kind>",
"path": "<path>"
},
"name": "tg_upload_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | ||
| path | Yes | Absolute path, or a path relative to the server process. | |
| confirm | No | ||
| account_id | No |