Skip to main content
Glama
zai-one

telegram-ads-mcp

by zai-one

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
stel_ssidYesThe stel_ssid cookie from ads.telegram.org
stel_tokenYesThe stel_token cookie from ads.telegram.org

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
check_sessionA

Ping the current ads.telegram.org session.

Returns owner_id, cabinet (ton/eur/stars), currency, balance.
Does not return api_hash or cookies. Stars cabinets are reported but not used.
If ok=false with code=auth, tell the user to refresh cookies in .env and call reload_session.
reload_sessionA

Re-read .env (STEL_TOKEN / STEL_SSID / STEL_ADOWNER) and rebuild the HTTP session.

Use this after the user updates cookies on disk. Never pass cookie values as arguments.
list_accountsA

List ad cabinets for this Telegram login. Works even on a Stars cabinet so you can switch away.

select_accountA

Switch the active ad cabinet. Then check_session / get_account.

Args:
    owner_id: From list_accounts.
get_accountA

Current cabinet card: owner_id, cabinet, currency (GRAM/EUR), balance.

get_adsA

List ads (100 per page). Filter by status client-side.

Args:
    offset_id: Pagination cursor from next_offset_id.
    status: any | active | on_hold.
get_adA

Fetch a single ad by id (API method, HTML state, or list fallback).

create_adA

Create an ad. Gram cabinets allow channels, bots, search, and users (geo). EUR too.

Always create on_hold. Budget "0" cannot go to review. IDs are semicolon-separated.
Search ads: do not pass text/picture/media.
Empty strings are stripped and not sent.
edit_adA

Edit an ad. Only provided fields are sent.

picture=True shows the avatar, picture=False turns it off (sends picture=0).
clear_media=True removes attached photo/video.
budget_action + budget_amount changes total budget (increase resumes a depleted ad).
Targeting cannot be changed after creation — clone_ad instead.
delete_adA

Delete an ad. First call without confirm_hash; pass the returned hash to confirm.

clone_adA

Duplicate an ad into a new draft. Targeting is copied; edit the clone if you need changes.

check_ad_postA

Validate promote URL + text before create/launch. Surfaces platform errors.

send_target_to_reviewA

Submit (or resubmit) targeting for review. Requires a non-zero budget.

launch_adA

Create on_hold, add budget, submit for review. Does not activate.

Returns each step so you can see which one failed. Prefer this over calling
create_ad + edit_ad + send_target_to_review by hand.
preview_adB

Render a sponsored-message preview PNG for chat, and save it under TG_ADS_PREVIEW_DIR (default ./previews).

upload_mediaA

Upload a photo (JPEG/PNG 16:9, <5 MB) or video (MP4 3–60s, <20 MB).

Pass a local file_path OR media_base64 (+ filename). Returns a media hash
to feed into create_ad(media=...) / edit_ad(media=...).
get_ad_statsA

Time-bucketed stats plus CTR / CPC / actual CPM.

period=5min → last 24h in 5-minute buckets. period=day → full lifetime daily.

search_targetsA

Search targeting entities.

kind=channel|bot|query|location, or similar_channels/similar_bots (pass ids as semicolon-separated).
purpose=target (placement) vs promote (destination URL lookup). Bots use field=bots vs promote_url.
get_targeting_referenceA

Countries / languages / topics for user-geo (Gram cabinets have this too) plus channel taxonomies.

Stars cabinets never reach this tool. Empty lists mean the form did not embed that taxonomy.

manage_audienceC

Custom audiences. action=list|create|rename|delete|clone.

create: pass file_path (one user id per line) or user_ids=[...].
delete/clone: two-step confirm_hash.
manage_eventC

Conversion events and pixels. action=list|create|rename|delete|create_pixel.

manage_fundsB

Funds. Currency follows the cabinet (Gram or EUR) — amount is a string.

action=add (top-up request), transfer, withdraw, search (find a cabinet), list (linked cabinets).

revoke_tokenA

Revoke and regenerate the cabinet API token (IP-whitelist token on ads.telegram.org).

save_api_settingsA

Set the IP whitelist for the cabinet API token. Newline-separated IPs.

log_outA

Log out of ads.telegram.org for this session. You will need fresh cookies in .env afterwards.

Prompts

Interactive templates invoked by user choice

NameDescription
launch-campaignEnd-to-end flow to create and submit a Telegram ad.
review-accountRead-only morning pass: balance, live vs stopped ads, stats on a few problems.
diagnose-adInspect one ad: card, stats, preview.

Resources

Contextual data attached and managed by the client

NameDescription
playbook_resourceAgent playbook: auth, create-on-hold, budget, review, Gram.
account_resourceCurrent cabinet: owner_id, currency, balance, type.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zai-one/telegram-ads-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server