Telegram Ads
v0.1.3MCP server for the official Telegram Ads API: ads, budgets, stats, audiences and pixels.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
tg_get_account Get Telegram Ads account
Get the current Telegram Ads account: account_id, title, currency, remaining budget and ad budget. Set include_related to also list accounts whose budgets this account can replenish. Start here to learn the account currency, which determines valid CPM and budget precision.
| Parameter | Type | Description |
|---|---|---|
include_related | boolean | Also list related accounts that this account can fund. |
limit | integer | |
offset | integer |
tg_get_account_info Get account profile
Get the billing/profile details of an account (company name, email, phone, country, city). Omit account_id to read the current account.
| Parameter | Type | Description |
|---|---|---|
account_id | string |
tg_account_budget Move budget between accounts
Increase or decrease the budget of a related account from the current account. amount uses the currency's amount precision (EUR/TON: 5 decimals, XTR: 3). Requires confirm: true and TG_ADS_MODE=write.
| Parameter | Type | Description |
|---|---|---|
account_id * | string | Related account to fund or withdraw from. |
amount * | number | |
direction * | string | |
confirm | boolean | |
idempotency_key | string |
tg_list_ads List ads
List advertisements for an account, newest first, with status, budgets and lifetime metrics. Use next_offset from the response to fetch the next page. Set include_targeting to receive targeting settings (larger response).
| Parameter | Type | Description |
|---|---|---|
account_id | string | |
include_targeting | boolean | |
limit | integer | |
offset | string | Pagination cursor from a previous response. |
tg_get_ads Get ads by ID
Fetch up to 100 advertisements by ad_id, including status, budgets, metrics and decline reasons.
| Parameter | Type | Description |
|---|---|---|
ad_ids * | array | |
account_id | string | |
include_targeting | boolean |
tg_create_ad Create ad
Create one advertisement. New ads are paused with a zero budget unless you pass is_paused: false and initial_budget. Money values must match the account currency precision (EUR/TON: 2 decimals, XTR: 0). Telegram requires text unless target.type is search, and at most one of photo_id/video_id. Use dry_run: true to validate without calling the API. Requires confirm: true and TG_ADS_MODE=write.
| Parameter | Type | Description |
|---|---|---|
cpm * | number | Price per 1000 impressions in the account currency. |
placement * | string | |
promote_url * | string | |
target * | ||
title * | string | |
account_id | string | |
activate_date | integer | Unix seconds. |
additional_info | string | |
button | string | |
confirm | boolean | |
conversion_event_id | string | |
daily_budget_limit | number | 0 disables the daily limit. |
deactivate_date | integer | Unix seconds. |
dry_run | boolean | |
idempotency_key | string | |
impression_frequency | integer | |
initial_budget | number | Defaults to 0, which keeps the ad unfunded. |
is_paused | boolean | Defaults to true. |
photo_id | string | |
schedule | object | |
show_userpic | boolean | |
text | string | |
video_id | string | |
website_name | string | |
website_photo_id | string |
tg_update_ad Update ad
Edit an existing advertisement. Only provided fields change. Use is_paused to pause or resume. Set submit_for_review: true to move a ready_for_review ad into review after editing. Changing cpm or budget requires the same currency precision rules as creation. Use dry_run: true to validate without calling the API. Requires confirm: true and TG_ADS_MODE=write.
| Parameter | Type | Description |
|---|---|---|
ad_id * | integer | |
account_id | string | |
activate_date | integer | |
additional_info | string | |
button | string | |
confirm | boolean | |
conversion_event_id | string | |
cpm | number | |
daily_budget_limit | number | |
deactivate_date | integer | |
dry_run | boolean | |
impression_frequency | integer | |
include_targeting | boolean | |
is_paused | boolean | |
photo_id | string | |
promote_url | string | |
schedule | object | |
show_userpic | boolean | |
submit_for_review | boolean | |
text | string | |
title | string | |
video_id | string | |
website_name | string | |
website_photo_id | string |
tg_ad_budget Increase or decrease ad budget
Move funds into or out of an ad. amount is in the account currency and must respect its precision. Telegram only allows decreasing budget when the ad has been inactive for at least 10 minutes. Requires confirm: true and TG_ADS_MODE=write.
| Parameter | Type | Description |
|---|---|---|
ad_id * | integer | |
amount * | number | |
direction * | string | |
account_id | string | |
confirm | boolean | |
include_targeting | boolean |
tg_delete_ad Delete ad
Permanently delete an advertisement. Telegram requires the ad to be inactive for at least 10 minutes and to have no remaining budget. Requires confirm: true and TG_ADS_MODE=write.
| Parameter | Type | Description |
|---|---|---|
ad_id * | integer | |
account_id | string | |
confirm | boolean |
tg_upload_media Upload ad media
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.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
path * | string | Absolute path, or a path relative to the server process. |
account_id | string | |
confirm | boolean |
tg_get_stats Get advertising stats
Get account or per-ad statistics for a time range. from/to accept Unix seconds, milliseconds, or ISO 8601. interval is 86400 (daily, default) or 300 (5 minutes). Ranges above 1000 intervals are split automatically. Always returns totals and derived CTR/CPM/CPC; set include_series for the raw time series. Timestamps are inclusive for from and exclusive for to.
| Parameter | Type | Description |
|---|---|---|
from * | ||
scope * | string | |
to * | ||
account_id | string | |
ad_ids | array | |
include_series | boolean | Include raw per-interval rows (default false). |
interval |
tg_get_report Get monthly account report
Get Telegram's monthly report for all active ads in an account, including views, opens, clicks, actions and spend per ad.
| Parameter | Type | Description |
|---|---|---|
month * | integer | |
year * | integer | |
account_id | string |
tg_list_targeting List targeting options
Look up targeting catalogs. kind=languages, topics or countries takes no extra arguments. kind=locations searches by country_code and/or query, or resolves location_ids. kind=channel resolves a channel by @username or numeric ID; kind=bot does the same for bots. Prefer @username for channels and bots: numeric IDs only work after this account has resolved them.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
account_id | string | |
bot | ||
channel | ||
country_code | string | Required for location search. |
for_excluding | boolean | |
limit | integer | |
location_ids | array | |
offset | string | |
query | string | Location search text. |
tg_list_audiences List audiences
List retargeting audiences for an account, or fetch specific audiences by ID. Audience sizes are in phone numbers.
| Parameter | Type | Description |
|---|---|---|
account_id | string | |
audience_ids | array | |
limit | integer | |
offset | integer |
tg_manage_audience Create, update or delete an audience
Manage phone-number retargeting audiences. action=create needs title and add_phones; action=update needs audience_id plus at least one change; action=delete needs audience_id. Phone numbers are sent to Telegram and are never written to the audit log. Requires confirm: true and TG_ADS_MODE=write.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
account_id | string | |
add_phones | array | |
audience_id | integer | |
confirm | boolean | |
remove_phones | array | |
reset_phones | boolean | |
title | string |
tg_get_pixel Get pixel
Get the account's Pixel Tag, including its ID and the HTML code snippet used to install it on a website.
| Parameter | Type | Description |
|---|---|---|
account_id | string |
tg_list_pixel_events List pixel events
List conversion events for the account's pixel, or fetch specific events by ID.
| Parameter | Type | Description |
|---|---|---|
account_id | string | |
event_ids | array | |
limit | integer | |
offset | integer |
tg_manage_pixel Manage pixel and conversion events
action=create_pixel creates the account's Pixel Tag (only one per account); action=create_event needs title and type; action=update_event renames an event; action=delete_event removes an event that is not used by any ad. Requires confirm: true and TG_ADS_MODE=write.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
account_id | string | |
confirm | boolean | |
event_id | string | |
title | string | |
type | string | Event type, for example purchase or lead. |
tg_list_transactions List transactions
List account-level or ad-level transactions. Use next_offset to page. Transactions explain where budget was added or spent.
| Parameter | Type | Description |
|---|---|---|
scope * | string | |
account_id | string | |
ad_id | integer | |
limit | integer | |
offset | integer |
tg_get_transaction Get transaction status
Check the status of a budget transaction by its transaction ID.
| Parameter | Type | Description |
|---|---|---|
transaction_id * | string |
tg_search Search Telegram Ads methods
Search the official Telegram Ads API methods by name, description or parameter. Use this to discover the right method before calling tg_api_call or writing a tg_execute script. Returns names, descriptions, write flags, return types and full parameter signatures.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
query | string | Empty returns all methods. |
write | boolean | Only return methods that change state. |
tg_get_sdk Get the Code Mode TypeScript SDK
Return the TypeScript declarations for the tg namespace available inside tg_execute. Read this before writing a non-trivial script; it documents every method signature.
tg_execute Execute a Telegram Ads script
Run JavaScript in an isolated QuickJS sandbox with a typed tg object, for multi-step work that would otherwise need many tool calls: bulk edits, cross-ad analysis, pagination, joins and reports. Only console.log output and the returned value come back. No network, filesystem, process or env access. Calls run sequentially; the limit is 25 API calls, 15 seconds and 64 KB of output. Example: `const ads = await tg.getAdsList({limit: 100}); return ads.ads.length`. Write methods require TG_ADS_MODE=write, TG_ADS_CODE_MODE=write and confirm: true.
| Parameter | Type | Description |
|---|---|---|
code * | string | An async arrow function, a function expression, or a plain statement body. |
confirm | boolean | Required before any write method can run. |
idempotency_key | string | Prefix for write idempotency keys, useful when retrying a script. |
tg_api_call Call any Telegram Ads API method
Escape hatch for methods that do not have a dedicated tool. Pass the exact method name from tg_search and its parameters. Read methods run immediately; write methods require TG_ADS_MODE=write and confirm: true, and receive an idempotency key automatically.
| Parameter | Type | Description |
|---|---|---|
method * | string | Exact method name, for example getTargetLocationsList. |
confirm | boolean | |
idempotency_key | string | |
params | object |