Skip to main content
Glama
ads-telegram-mcp

ads-telegram-mcp

by Draniev

ads-telegram-mcp

MCP-сервер для работы с Telegram Ads из ИИ-ассистентов. Позволяет просматривать аккаунты и объявления, запрашивать статистику, получать месячные отчёты, создавать объявления и загружать медиа.

Сервер работает локально через stdio. Доступны 11 инструментов: 9 для чтения данных и 2 для создания объявлений и загрузки медиа.

Установка

Понадобятся:

Для загрузки видео также нужен ffprobe из FFmpeg, доступный в PATH процесса сервера. Для текстовых объявлений и фото он не требуется.

Скачайте исходники проекта, перейдите в его каталог и установите зависимости:

cd ads-telegram-mcp
uv sync --locked
cp .env.example .env

Откройте .env и укажите токен:

TELEGRAM_ADS_TOKEN=your_api_token

Related MCP server: Telegram MCP Server

Настройки

Переменная

Назначение

TELEGRAM_ADS_TOKEN

API-токен для доступа к Telegram Ads. Нужен для запросов данных.

TELEGRAM_ADS_ACCOUNT_ID

Необязательный ID связанного аккаунта, который будет использоваться по умолчанию.

Сервер читает .env из корня проекта независимо от каталога запуска. Переменные окружения имеют приоритет над .env, включая пустые значения. Токен можно задать в окружении MCP-клиента вместо файла. .env исключён из Git.

При выборе аккаунта действует следующий порядок:

  1. account_id, переданный инструменту.

  2. TELEGRAM_ADS_ACCOUNT_ID, если он задан.

  3. Аккаунт, которому принадлежит токен.

get_current_account всегда возвращает владельца токена. list_related_accounts получает связанные аккаунты владельца токена, а get_accounts_by_id использует переданный список ID. Чтобы обратиться к владельцу токена при заданном аккаунте по умолчанию, передайте его ID явно.

Подключение к MCP-клиенту

Для клиентов с конфигурацией mcpServers:

{
  "mcpServers": {
    "telegram-ads": {
      "command": "uv",
      "args": [
        "--directory", "/absolute/path/ads-telegram-mcp",
        "run", "--locked", "python", "-m", "ads_telegram_mcp"
      ]
    }
  }
}

Замените /absolute/path/ads-telegram-mcp на полный путь к проекту. Если MCP-клиент не находит uv, укажите полный путь к исполняемому файлу в command. Токен будет загружен из .env.

Для Codex добавьте в ~/.codex/config.toml:

[mcp_servers.telegram_ads]
command = "uv"
args = ["--directory", "/absolute/path/ads-telegram-mcp", "run", "--locked", "python", "-m", "ads_telegram_mcp"]
tool_timeout_sec = 300

После сохранения настроек перезапустите MCP-подключение.

Для ручного запуска из каталога проекта:

uv run --locked python -m ads_telegram_mcp

При ручном запуске сервер ожидает сообщения MCP на stdin. Отсутствие приглашения или вывода в терминале — нормальное поведение.

Использование

После подключения попросите ассистента, например:

  • «Покажи баланс и валюту текущего аккаунта Telegram Ads».

  • «Выведи первые 20 объявлений и их статусы».

  • «Получи дневную статистику аккаунта за прошлую неделю и посчитай расход».

  • «Покажи итоги за прошлую неделю отдельно по каждому объявлению».

  • «Покажи месячный отчёт по объявлениям за октябрь 2026 года».

  • «Проверь параметры двух новых объявлений через dry_run».

  • «Загрузи фото и создай с ним объявление без бюджета, на паузе».

Ассистент выберет инструменты и передаст им параметры. Доступ к данным определяется правами API-токена.

Доступные инструменты

Инструмент

Что возвращает

get_current_account

Аккаунт владельца токена, его балансы и валюту.

list_related_accounts

Одну страницу связанных аккаунтов.

get_accounts_by_id

Данные аккаунтов по списку ID.

list_ads

Одну страницу объявлений выбранного аккаунта.

get_ads_by_id

Объявления по списку ID, при необходимости с таргетингом.

get_account_stats

Статистику аккаунта за период с разбивкой по интервалам.

get_ad_stats

Статистику одного объявления за период с разбивкой по интервалам.

get_ads_stats

Итоги за произвольный период по выбранным или всем объявлениям; при необходимости — разбивку по интервалам.

get_account_report

Месячные итоги по активным объявлениям аккаунта.

create_ads

Результаты создания одного или нескольких объявлений либо локальной проверки через dry_run.

upload_media

ID загруженного фото, видео или изображения сайта и проверенные метаданные файла.

Создание объявлений

create_ads принимает непустой список ads. Общие параметры:

  • account_id — аккаунт по общим правилам настройки;

  • dry_run=false — при true проверяются только входные данные, без API-запросов;

  • stop_on_error=true — после первой ошибки остальные элементы не создаются. При false обработка продолжается; ошибки авторизации, прав доступа и частоты запросов в любом случае останавливают пакет. Неожиданные ошибки клиента также прекращают дальнейшие записи.

У каждого объявления обязательны title, promote_url, cpm, placement, target и idempotency_key. text обязателен, кроме таргетинга search. Типы таргетинга: channels, users, bots, search; параметры каждого типа описаны в схеме инструмента. placement задаётся отдельно от типа таргетинга.

Пример локальной проверки одного объявления:

{
  "dry_run": true,
  "ads": [
    {
      "title": "Первый вариант",
      "text": "Маршруты и заметки о путешествиях — в нашем канале.",
      "promote_url": "https://t.me/example_channel",
      "cpm": 0.3,
      "placement": "channel_post",
      "target": {"type": "channels", "channel_ids": ["@example_placement"]},
      "idempotency_key": "3b284a89-7d93-48e0-986d-7866a90d8801"
    }
  ]
}

Замените пример своими параметрами. Для создания задайте dry_run=false. Допустимость CPM зависит от аккаунта и параметров объявления; значение в примере условное. Локальная проверка не подтверждает права, остаток бюджета, допустимость ставки, media ID или прохождение модерации. В dry run валюта не запрашивается и возвращается как null.

По умолчанию initial_budget=0, is_paused=true. Положительный initial_budget переводит средства из аккаунта в объявление и может вызвать автоматическую отправку на модерацию. activate_date и deactivate_date переопределяют паузу по правилам API. Все денежные параметры задаются в валюте выбранного аккаунта.

Поддерживаются настройки внешнего сайта, фото или видео, частоты, дневного лимита, дат, расписания и существующего события конверсии. Для внешней ссылки нужно website_name. Одновременно использовать photo_id и video_id нельзя.

В ответе находятся account_id, currency, счётчики, complete и results в исходном порядке. У каждого результата есть index (с нуля), ключ и outcome:

  • succeeded — получен успешный ответ API и данные объявления;

  • failed — получен отказ;

  • unknown — исход не подтверждён, например из-за сетевой ошибки;

  • not_attempted — элемент не выполнялся после остановки пакета.

complete=true означает успех всех элементов. Уже созданные объявления сохраняются при частичном результате. Успешный ответ может быть повтором ранее выполненного запроса, а не новым созданием.

При повторе сохраняйте idempotency_key и все параметры объявления. Telegram хранит результат по ключу до 24 часов. После этого тот же запрос может создать ещё одно объявление. Порядок элементов, повторяющиеся ключи и объявления сервер не меняет. Дополнительные сведения доступны через get_ads_by_id.

Загрузка медиа

upload_media принимает абсолютный file_path на машине, где запущен сервер, kind и необязательный account_id. Файл отправляется в Telegram Ads.

kind

Требования

ad_photo

JPEG/PNG, до 5 МиБ, ширина от 640 px, 16:9.

ad_video

MP4, до 20 МиБ, ширина от 640 px, 16:9, 3–60 секунд. Нужен ffprobe.

website_photo

JPEG/PNG, до 1 МиБ, минимум 150×150 px.

Ответ содержит account_id, kind, photo_id/photo_url или video_id/video_url, а также metadata с форматом, размером файла, размерами кадра и длительностью видео.

Передавайте полученный ID в create_ads. Его можно использовать повторно для нескольких объявлений того же аккаунта. Повтор загрузки файла может вернуть новый ID. Загрузка медиа сама по себе не создаёт объявление.

Статистика нескольких объявлений

get_ads_stats получает статистику каждого объявления за один вызов MCP. Передайте from_time и to_time, а также необязательные параметры:

  • ad_ids — список ID. Пустой или пропущенный список означает все объявления, доступные в списке аккаунта, включая остановленные. Сервер сам загружает страницы списка. Переданный список ID используется без изменений.

  • include_timeseries — по умолчанию false. Значение true добавляет к итогам исходные строки статистики за каждый интервал.

  • interval — 86400 секунд по умолчанию или 300 секунд.

  • account_id — аккаунт, выбранный по общим правилам настройки.

Пример параметров для всех объявлений за 30 октября — 5 ноября 2026 года по UTC:

{
  "from_time": 1793318400,
  "to_time": 1793923200,
  "ad_ids": []
}

Для выбранных объявлений замените [] на список, например [101, 202].

В ответе ads содержит по каждому объявлению ad_id, количество точек data_points и totals: показы, открытия, клики, действия, расход и валюту. Если API вернул пустой ряд, totals равен null. При include_timeseries=true в каждом элементе появляется stats с разбивкой по интервалам.

Проверяйте complete, succeeded_count, failed_count и errors: при ошибке отдельного объявления сервер возвращает доступные результаты и отмечает неполный ответ как complete: false. Ошибки авторизации, прав доступа или ограничения частоты запросов прекращают операцию. total_count — число обрабатываемых элементов списка ID, включая повторы; from_time и to_time в ответе — границы периода после округления к началу интервала.

Количество запросов к Telegram API зависит от числа объявлений. Для больших аккаунтов увеличьте таймаут инструмента в MCP-клиенте.

Параметры и ограничения

  • ID аккаунта передаётся строкой. ID объявления — целым числом; он уникален внутри аккаунта.

  • list_ads и list_related_accounts возвращают по 20 записей по умолчанию; limit — от 1 до 100. Автоматической загрузки всех страниц нет. Для связанных аккаунтов увеличивайте offset на число полученных записей до total_count. Для объявлений передавайте полученный next_offset без изменений, пока он присутствует в ответе.

  • get_accounts_by_id и get_ads_by_id принимают от 1 до 100 ID за вызов.

  • У list_ads и get_ads_by_id параметр return_target=true включает настройки таргетинга в ответ. По умолчанию он выключен.

  • Для статистики нужны from_time и to_time в Unix-секундах. Начало периода включается, конец — нет. interval равен 86400 секундам по умолчанию; также доступен интервал 300 секунд. Границы округляются к началу интервала; период — не более 1000 интервалов. Для get_ads_stats после округления должен оставаться хотя бы один интервал.

  • Для месячного отчёта задайте year от 2021 до 2100 и month от 1 до 12.

  • Денежные значения возвращаются в валюте аккаунта: EUR, TON или XTR.

Если инструмент сообщает об отсутствии TELEGRAM_ADS_TOKEN, проверьте .env и окружение MCP-клиента: пустая переменная окружения перекрывает значение из файла.

Зависимости и документация

Основные зависимости: MCP Python SDK, TeleAd — клиент Telegram Ads API, Pydantic, pydantic-settings, AnyIO и Pillow. Версии указаны в pyproject.toml и зафиксированы в uv.lock.

Лицензия

MIT. Copyright (c) 2026 Sergei Popov.

Available Tools

11 tools
create_adsA
Destructive

Create one or more ads in order, or validate them locally with dry_run.

Defaults are zero initial budget and paused delivery. Positive budget transfers account funds and may trigger review. Activation/deactivation dates override is_paused. Amounts use the selected account's currency.

Each ad requires an idempotency_key. Retry with the same key and identical parameters within 24 hours; later retries may create another ad. Duplicates are not removed. No rollback is performed.

Outcomes are succeeded, failed, unknown, or not_attempted. For unknown outcomes retry with the original key. stop_on_error defaults to true; authentication, permission and rate-limit errors always stop the batch. Unexpected client failures also stop remaining writes.

dry_run makes no API calls and does not check access, budget or moderation. Omitted account_id uses the configured default or the token owner.

NameRequiredDescriptionDefault
adsYes
dry_runNo
account_idNo
stop_on_errorNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations (readOnly=false, destructive=true, openWorld=true, idempotent=false) by disclosing that duplicates are not removed, no rollback occurs, positive budget transfers real funds and may trigger review, the idempotency window is 24 hours, and auth/permission/rate-limit errors always stop the batch regardless of stop_on_error. It also enumerates the four outcome states and the retry rule for 'unknown', which is exactly the operational context an agent needs before a destructive write.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense and front-loaded: creation, then defaults, then idempotency, then outcomes, then dry_run caveats. Nearly every sentence carries distinct operational information; the only soft spots are the slightly fragmented line-by-line layout and the repeated mention of review triggering for positive budgets.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, multi-item, open-world write tool with deeply nested target variants, the description covers defaults, monetary side effects, idempotency lifetime, partial-failure semantics, and dry_run blindness. An output schema exists, yet the description still names the outcome vocabulary (succeeded/failed/unknown/not_attempted), which is a useful bonus rather than a redundancy.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Top-level schema coverage is 0%, so the description must carry the load, and it does for most of the four parameters: dry_run's semantics and blind spots, stop_on_error's default and its exceptions, account_id's fallback resolution, and the per-ad idempotency_key reuse rule. It adds little about the 'ads' array itself (e.g. no note on per-item ordering effects beyond 'in order'), which keeps it from a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource ('Create one or more ads in order') plus a distinct second mode ('or validate them locally with dry_run'), so an agent immediately knows this is a batch write tool with a validation path. That clearly separates it from the read-only siblings like list_ads, get_ads_by_id, and get_ads_stats.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete when-to-use guidance for dry_run and explicit when-not caveats ('makes no API calls and does not check access, budget or moderation'), and tells the agent to retry with the original key for unknown outcomes. It stops short of describing batch-size limits or when to prefer creating ads singly, but for a tool with no create-sibling that gap is minor.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_account_reportA
Read-onlyIdempotent

Get per-ad totals for a calendar month.

Returns a report of active ads for the given year and month. Monetary values use each item's currency.

Omitted account_id uses TELEGRAM_ADS_ACCOUNT_ID if set, otherwise the token owner's account.

NameRequiredDescriptionDefault
yearYes
monthYes
account_idNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, open-world), so credit goes to what the text adds: only active ads are reported, monetary values follow each item's currency, and account_id falls back to TELEGRAM_ADS_ACCOUNT_ID then the token owner's account. The fallback resolution chain is real behavioral information an agent cannot get from the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core function and kept to four short lines with no filler. The second sentence ("Returns a report of active ads for the given year and month") largely restates the first, which is the only notable redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return shape need not be described, and the description still adds output-relevant facts (active ads only, per-item currency). The main remaining gap is disambiguation from the sibling stats tools, which matters for a report tool in a crowded family.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it does so only for account_id (the env-var/token-owner default chain). Year and month get no added meaning beyond "calendar month" and the schema's own 1-12 / 2021-2100 bounds, and nothing is said about timezone or month-boundary handling.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Get per-ad totals for a calendar month" gives a specific verb (get), resource (account report / per-ad totals), and granularity (calendar month). It partially separates itself from the stats siblings by specifying a per-ad breakdown over a monthly window, though it never names get_account_stats or get_ads_stats directly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: the agent can infer "use this for a monthly per-ad breakdown" from the scope wording. With four stats-related siblings (get_account_stats, get_ad_stats, get_ads_stats, this tool) there is no explicit when-to-use/when-not or alternative routing rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_accounts_by_idA
Read-onlyIdempotent

Get balances and currencies for the specified account IDs.

Accepts 1 to 100 IDs of accounts accessible to this token. Uses account_ids directly, regardless of the default related account.

NameRequiredDescriptionDefault
account_idsYes

Output Schema

NameRequiredDescription

No output parameters

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover read-only, idempotent, non-destructive, and open-world behavior. The description adds meaningful context beyond that: the accounts must be accessible to this token, and the call bypasses the default related account. It does not discuss return format or pagination, but the output schema exists to cover returns.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, front-loaded with the core purpose. Each sentence adds distinct value: action, count/auth scope, and the default-account bypass nuance. No wasted wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a simple read-only lookup with one parameter, annotations, and an output schema. The description covers purpose, scope, auth constraints, and a key behavioral nuance. It could say more about handling invalid or inaccessible IDs, but for this complexity level it is largely complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must supply meaning. It explains that account_ids are IDs of accounts accessible to this token, restates the 1-to-100 count range, and clarifies that the IDs are used directly rather than via the default related account. That is substantial semantic value for the single parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb (Get) and resource (balances and currencies) scoped to specified account IDs. It implicitly distinguishes itself from default-account siblings by stating it uses account_ids directly regardless of the default related account, though it never names those siblings explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is implied: call this when you have one or more account IDs and need their balances/currencies. It notes the 1-to-100 ID limit and token-accessibility constraint, but gives no explicit when-to-use-vs-alternatives guidance or exclusions beyond the default-related-account note.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_account_statsA
Read-onlyIdempotent

Get account statistics for [from_time, to_time), in Unix seconds.

Returns a time series in intervals of 300 or 86400 seconds. The API rounds bounds to interval starts; at most 1000 intervals are allowed. Monetary values use the returned currency.

Omitted account_id uses TELEGRAM_ADS_ACCOUNT_ID if set, otherwise the token owner's account.

NameRequiredDescriptionDefault
to_timeYes
intervalNo
from_timeYes
account_idNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, open-world), so the description's job is to add operational detail — and it does: bounds are rounded to interval starts, there is a hard 1000-interval cap, granularity is fixed at 300 or 86400 seconds, and monetary values follow the returned currency. The only gap is return shape and what happens when the requested window exceeds the 1000-interval limit, but the output schema covers return values.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short sentences, front-loaded with the verb and resource, then constraints, then the account_id fallback rule. No sentence is redundant and the line breaks separate distinct concerns cleanly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only time-series tool with an output schema, annotations, and four short parameters, the description supplies everything an agent needs to call it correctly: units, rounding, interval options, the interval cap, and account resolution. Nothing material is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage the description carries the full burden, and it names all four parameters' meaning: from_time/to_time as Unix seconds in a half-open range with rounding behavior, interval as the 300/86400 granularity, and account_id defaulting to TELEGRAM_ADS_ACCOUNT_ID or the token owner. It adds real semantics beyond the bare 'To Time'/'Account Id' titles; a minor gap is not restating the interval default of 86400.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Get account statistics') with the scope immediately qualified by a half-open time range in Unix seconds. An agent can distinguish this from get_ads_stats or get_account_report by the 'account' scope, but the description never explicitly contrasts with those siblings, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage boundaries are implied by the time-range framing rather than stated: nothing says when to prefer this over get_account_report or get_ads_stats, and there are no exclusions. The operational constraint (max 1000 intervals) and the account_id fallback rule give some context, but the choice among sibling analytics tools is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_ads_by_idA
Read-onlyIdempotent

Get selected ads by their IDs.

Accepts 1 to 100 IDs. Ad IDs are unique within an account. Set return_target to include targeting settings.

Omitted account_id uses TELEGRAM_ADS_ACCOUNT_ID if set, otherwise the token owner's account.

NameRequiredDescriptionDefault
ad_idsYes
account_idNo
return_targetNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent, non-destructive, openWorld, so the safety profile is covered. The description adds real behavior beyond that: a hard 1-100 batch bound, per-account ID uniqueness, the effect of return_target, and an account-resolution fallback chain (TELEGRAM_ADS_ACCOUNT_ID, then token owner). It is silent on what happens with unknown or cross-account IDs, which is a minor remaining gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short lines, front-loaded with the core action, then limits, then the optional flag, then the default resolution rule. No redundant restatement of the name or title, and every sentence adds a distinct fact.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a simple read tool with an output schema, so return shape need not be explained, and annotations cover safety. The description covers batching, account resolution, and the optional targeting payload; error behavior for missing IDs is the only notable omission.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden, and it does so for all three parameters: ad_ids (count limits and account-scoped uniqueness), account_id (env-var and token-owner fallback), and return_target (pulls in targeting settings). Only the array-of-integers typing is left to the schema, which is acceptable.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource (get ads by their IDs) and states the key scoping fact that ad IDs are unique within an account. It implicitly contrasts with the listing sibling (list_ads) by emphasizing lookup by ID, but never names the alternative explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete usage context (batch of 1-100 IDs, IDs unique per account) and a defaulting rule for account_id, which tells the agent how to call it. It does not state when to prefer this over list_ads or get_ads_stats, so routing between siblings is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_ads_statsA
Read-onlyIdempotent

Get per-ad totals for [from_time, to_time), in Unix seconds.

The period must not exceed 1000 intervals.

Empty or omitted ad_ids selects all ads via automatic paging, regardless of status. Provided ad_ids are used as supplied. Set include_timeseries to include interval rows.

Returns rounded bounds, per-ad totals, counts, complete and errors. Totals are null when no data is available. Check complete and errors before treating the result as complete.

Omitted account_id uses TELEGRAM_ADS_ACCOUNT_ID if set, otherwise the token owner's account.

NameRequiredDescriptionDefault
ad_idsNo
to_timeYes
intervalNo
from_timeYes
account_idNo
include_timeseriesNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/idempotent annotations it discloses several non-obvious behaviors: a hard 1000-interval cap, implicit paging when ad_ids is empty, that supplied ad_ids are used verbatim, that account_id falls back to TELEGRAM_ADS_ACCOUNT_ID then the token owner, and that totals are null when data is absent. It also instructs the agent to check complete and errors before trusting results, which is exactly the kind of caveat annotations cannot express.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and time-range constraint are front-loaded in the first sentence, followed by short paragraphs each addressing one concern (paging, timeseries, return shape, defaults). No sentence is redundant or restates the schema, and the warning about complete/errors lands where an agent will read it before calling.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return fields need not be fully documented, yet the description still summarizes the payload (rounded bounds, per-ad totals, counts, complete, errors) and flags null totals. The only real gap against a 6-parameter stats tool is the unexplained interval parameter and its interaction with the 1000-interval limit.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage the description carries the full burden and covers five of six parameters meaningfully: from/to semantics (half-open interval in Unix seconds), ad_ids empty-vs-supplied behavior, include_timeseries effect, and account_id defaulting chain. The interval parameter itself is never explained — neither the 300 vs 86400 enum values nor the 86400 default — so the largest remaining ambiguity is left unaddressed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence states a specific verb and resource ("Get per-ad totals") plus the scope ([from_time, to_time), Unix seconds), which lets an agent separate it from get_account_stats and get_ads_by_id. It stops short of explicitly distinguishing it from the singular get_ad_stats sibling, leaving the plural/singular distinction to inference from the name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives operational conditions (period must not exceed 1000 intervals, empty ad_ids triggers automatic paging, include_timeseries adds interval rows) but never states when to choose this over get_ad_stats, get_account_stats, or get_account_report. The when-to-use decision is implied by output granularity rather than spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_ad_statsA
Read-onlyIdempotent

Get one ad's statistics for [from_time, to_time), in Unix seconds.

Returns a time series in intervals of 300 or 86400 seconds. The API rounds bounds to interval starts; at most 1000 intervals are allowed. The ad ID is scoped to the selected account.

Omitted account_id uses TELEGRAM_ADS_ACCOUNT_ID if set, otherwise the token owner's account.

NameRequiredDescriptionDefault
ad_idYes
to_timeYes
intervalNo
from_timeYes
account_idNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations (which already declare readOnly/idempotent/non-destructive), the description discloses several non-obvious behaviors: the 300/86400 interval granularity, server-side rounding of bounds to interval starts, a hard cap of 1000 intervals, and ad-ID scoping to the selected account. It also explains account resolution (TELEGRAM_ADS_ACCOUNT_ID, else token owner), which is the kind of implicit-state behavior an agent cannot infer from the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action and time semantics are front-loaded in the first two lines, with constraints following. All five sentences carry information, though the line-broken formatting reads as an unordered list of facts rather than a deliberately structured brief.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-shape explanation is correctly omitted, and the description covers the constraints an agent needs before calling (interval cap, rounding, account default). It stops short of saying what happens when the 1000-interval cap is exceeded or when ad_id is invalid for the account, which matters for a read call that can fail on bounds.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry the parameter burden and it largely does: from_time/to_time are Unix seconds in a half-open range, interval values mirror the enum, account_id has a documented default resolution chain, and ad_id is described as account-scoped. Minor omissions (the 86400 default, non-negative minimums) are already encoded in the schema itself.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ("Get one ad's statistics") and bounds the scope with a half-open time range in Unix seconds. The word "one" implicitly separates it from the plural sibling get_ads_stats and from get_account_stats, but it never names those alternatives, so the differentiation is inferential rather than explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use or when-not-to-use guidance, and none of the plausible alternatives (get_ads_stats for multiple ads, get_account_stats, get_account_report) are mentioned. The only routing-adjacent information is the account_id fallback rule, which is about defaults rather than tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_current_accountA
Read-onlyIdempotent

Get the token owner's account, balances and currency.

Always returns the token owner, regardless of the default related account.

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription

No output parameters

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description adds a genuine behavioral nuance — it always resolves to the token owner and ignores the default related account — but says nothing about auth requirements, failure modes, or response shape (though an output schema exists).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, zero waste: the first states the operation and the second front-loads the disambiguating constraint immediately after. Nothing could be removed without losing meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless, read-only lookup with full annotation coverage and an output schema, the description covers purpose and scope adequately. Only the absence of any note on auth/error behavior keeps it from being fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so there is nothing for the description to disambiguate; the baseline of 4 applies. The description correctly omits any parameter discussion rather than inventing one.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ('Get the token owner's account, balances and currency') and implicitly separates this tool from related-account siblings via 'regardless of the default related account.' It does not name `list_related_accounts` or `get_accounts_by_id` outright, so differentiation requires a small inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The second sentence provides clear context: use this when the token owner's own account is wanted, even if a default related account is configured — which is the key distinction from the related-account tools. It stops short of explicitly naming the alternative sibling to use instead, so a 4 rather than a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_adsA
Read-onlyIdempotent

Get one page of ads from an account.

For the next page, pass the returned next_offset unchanged as offset. This tool does not load additional pages automatically. Set return_target to include targeting settings.

Omitted account_id uses TELEGRAM_ADS_ACCOUNT_ID if set, otherwise the token owner's account.

NameRequiredDescriptionDefault
limitNo
offsetNo
account_idNo
return_targetNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds genuinely new behavior: single-page semantics, no auto-pagination, reliance on an unchanged opaque offset token, and account resolution via the TELEGRAM_ADS_ACCOUNT_ID environment variable — none of which appear in structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Each of the four short blocks addresses one decision the caller must make (page fetching, pagination behavior, targeting payload, account resolution) and the core purpose is front-loaded in the first sentence. Nothing is redundant or padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return values need no explanation, and the description covers the pagination and account-defaulting behaviors an agent must know to call this correctly. The only minor gap is the absence of any note on limit's effect or default.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the burden, and it does for three of four parameters: offset must be the returned next_offset verbatim, account_id falls back to an env var then the token owner's account, and return_target toggles inclusion of targeting settings. Only limit is left unexplained, though its 1-100 bounds are visible in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise verb+resource+scope statement: 'Get one page of ads from an account.' The 'one page' qualifier immediately distinguishes it from a full-listing or single-record retrieval tool such as get_ads_by_id, so the agent can select it without inspecting the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete operational guidance: how to fetch subsequent pages ('pass the returned next_offset unchanged as offset'), that pagination is not automatic, and when to set return_target. It does not explicitly contrast itself with get_ads_by_id or get_ads_stats, so the when-to-use-versus-siblings dimension is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

upload_mediaA

Upload a local photo, MP4 video, or website photo to Telegram Ads.

file_path must be an absolute path on the server machine. The file's bytes are transmitted to Telegram. Images are checked with Pillow; video metadata validation requires ffprobe from FFmpeg on PATH.

Returns account_id, kind, photo_id/photo_url or video_id/video_url, and validated media metadata. Reuse the ID only in the same account. Upload retries may create a new media ID; no idempotency key is available.

Omitted account_id uses the configured default or the token owner.

NameRequiredDescriptionDefault
kindYes
file_pathYes
account_idNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare the generic profile (openWorld, non-idempotent, non-destructive); the description adds the material behavior the agent actually needs: file bytes leave the machine for Telegram, local runtime dependencies (Pillow, ffprobe) can cause failure, media IDs are account-scoped, and there is no idempotency key so retries may duplicate media. This is meaningful disclosure well beyond the annotation flags.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The first sentence pins the purpose, followed by preconditions, return summary, ID-reuse constraint, and retry caveat in short declarative blocks. Every sentence adds operational information and the most important constraints are front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter upload tool with an output schema, the description covers prerequisites, scoping, defaults, and the non-idempotency risk — everything needed to call it correctly or decide against retrying. The return summary is slightly redundant with the output schema but costs nothing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry the load, and it does for two of three parameters: file_path is constrained to an absolute server-side path with its bytes transmitted, and account_id's fallback to the configured default or token owner is spelled out. The kind parameter is only described indirectly via the media-type list rather than mapping ad_photo/ad_video/website_photo explicitly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — 'Upload a local photo, MP4 video, or website photo to Telegram Ads' — and enumerates the supported media types, which map onto the three kind enum values. No sibling tool performs uploads, so no disambiguation is required, and an agent can tell immediately what this does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete preconditions for use: file_path must be an absolute server path, images are validated with Pillow, and video uploads require ffprobe from FFmpeg on PATH. It also warns that reuse should stay within the same account and that retries may create a new media ID. It does not state explicit when-not-to-use cases, but there is no competing sibling to route away from.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 11 tool updatesv0.1.0
    • First observedcreate_ads
    • First observedget_account_report
    • First observedget_account_stats
    • First observedget_accounts_by_id
    • First observedget_ad_stats
    • First observedget_ads_by_id
    • First observedget_ads_stats
    • First observedget_current_account
    • First observedlist_ads
    • First observedlist_related_accounts
    • First observedupload_media

TDQS

A3.9/5.0

Scored across 11 tools

Disambiguation4/5

Account tools (current, related, by-id) and ad tools (create, list, by-id) have clearly distinct purposes. The stats family is mostly separable, though get_ads_stats (per-ad totals for an arbitrary window) and get_account_report (per-ad totals for a calendar month) overlap in intent, and get_ads_stats vs get_ad_stats differ only by plural and require reading descriptions to distinguish.

Naming Consistency4/5

Names follow a consistent snake_case verb_noun convention (get_*, list_*, create_*, upload_*). The singular/plural shifts (get_ad_stats vs get_ads_stats, get_accounts_by_id vs get_current_account) are semantically meaningful but make the surface slightly less predictable at a glance.

Tool Count5/5

Eleven tools is well within a comfortable range for a domain covering accounts, ads, stats, reporting, and media. Each tool maps to a distinct resource/action, so none feels redundant padding.

Completeness3/5

Read and create paths are solid (accounts, ad listing, ad creation, several stats views, media upload), but there is no update/pause/delete or edit operation for ads, so the lifecycle dead-ends after creation. Targeting appears only as a read flag (return_target), with no way to modify it, which will force agents into workarounds.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    An MCP server that lets AI agents read and manage Telegram Ads campaigns, including listing accounts and ads, reading stats and budgets, and creating/updating ads, CPM, status, and budget by driving the real ads.telegram.org web UI through Playwright with a reused cookie-based login session.
    11
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to control a personal Telegram account for sending/reading messages, media, group management, and more via the MTProto API.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides typed tools for ads.telegram.org, enabling login via Playwright and a read-only watcher through a local stdio MCP server.
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    Enables AI agents to create, target, pause, and read stats for Telegram Ads campaigns through ads.telegram.org using a logged-in session, with tools for managing ads, creatives, targeting, and account settings.
    26
    4
    -