Telegram Dev

v0.9.0
io.github.Kay0k1/telegram-dev Checked 3 days ago Published 24 days ago

Current official Telegram and TON docs: Bot API, Mini Apps, MTProto, TDLib, TON Connect, Tolk

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_telegram_docs Search Telegram and TON docs

Find the official documentation sections that answer a Telegram or TON development question. Use it before writing or reviewing code that calls the Bot API, Mini Apps JS, Telegram API/MTProto, TDLib, TON Connect, Tolk contracts or the aiogram, python-telegram-bot and grammY libraries. Returns up to `limit` sections with page URL, heading, excerpt, `document_offset` and freshness. Excerpts are partial: open the page with `get_telegram_document` at `document_offset` before relying on details. Stale matching pages are re-fetched first. An empty result is not proof that a feature does not…

ParameterTypeDescription
query *stringExact API names or short English keywords work best, e.g. 'InlineKeyboardButton style', 'sendVideoNote', 'ton_proof', 'jetton transfer', 'aiogram Router callback_query'. Common Russian feature words (…
areastringLimit results to one documentation area; empty searches all areas. Core Telegram docs rank above library docs unless the query names a library.
limitintegerMaximum number of matching sections to return.

get_telegram_document Read an official documentation page

Read the text of an official Telegram, TON or bot-library documentation page, one window at a time. Use it to read requirements, parameters and limits in full after `search_telegram_docs` found the page, or to load an entry page from `list_telegram_sources` into an empty cache. Do not use it to find which page answers a question: search first. Pages missing from the cache or older than the freshness limit (6 hours by default) are fetched first. Returns title, URL, Markdown `body` for the requested window, `next_offset` (null at the end), `total_characters`, content hash and freshness.…

ParameterTypeDescription
url *stringOfficial page URL from search results or list_telegram_sources, e.g. https://core.telegram.org/bots/api or https://docs.ton.org/applications/ton-connect/overview. Pages outside the official sources ar…
lengthintegerNumber of characters to return.
offsetintegerCharacter offset to start from; use a search result's document_offset or the previous next_offset.
refreshbooleanForce a live check of the source even if the cached copy is fresh.

get_telegram_corpus_status Cache coverage and freshness

Report how complete and how current the local documentation cache is, as totals. Use it at the start of a task or when search results look incomplete. Returns `pages`, per-area counts (`families`), crawl queue state (`frontier`), `stale_pages`, last and oldest successful checks, `refresh_policy` and up to 15 recent source `errors`. For the configured entry points use `list_telegram_sources`; for the individual cached pages use `list_telegram_cached_pages`; to answer a question use `search_telegram_docs`. Refreshing is automatic (on read, on search and in a background cycle), so there…

list_telegram_document_revisions Observed revisions of a page

List the revisions of one documentation page that this installation has observed, newest first. Use it to see whether a page changed since an earlier read. To read the current text use `get_telegram_document`. Returns `revisions`: a list of {sha, captured_at, characters}, newest first. A page that this installation has never fetched returns an empty list; a URL outside the official sources is rejected with an error. It does not reconstruct history before the page was first fetched here; for Telegram release history use `list_bot_api_changes` or the changelogs (area `releases` or `ton-…

ParameterTypeDescription
url *stringOfficial page URL, the same form accepted by get_telegram_document.

list_telegram_sources Official documentation entry points

List the official entry points this server crawls, each with its documentation area. Use it to find where to start reading for an unfamiliar area (for example the Bot API index, docs.ton.org/llms.txt or a library's docs) and pass the URL to `get_telegram_document`. If you already know the feature or API name, use `search_telegram_docs` instead. Returns `sources`: a list of {url, area} in the configured order (Telegram core docs, then TON, then bot libraries), and a short `scope` note. This is the source configuration, not the cache: `list_telegram_cached_pages` shows what is already s…

list_telegram_cached_pages List cached documentation pages

List the documentation pages already stored in the local cache, sorted by URL. Use it to see which pages of an area are available offline or to pick a page to open with `get_telegram_document`. Filter with `area`, page through results with `offset` and `limit`. Returns `pages` (url, title, area, checked_at, freshness), `total` matching pages and `next_offset` to pass back for the next page (null at the end). It lists stored pages only; to find content by topic use `search_telegram_docs`, and for totals and errors use `get_telegram_corpus_status`.

ParameterTypeDescription
areastringOnly pages from this documentation area; empty lists all areas.
limitintegerMaximum number of pages to return.
offsetintegerNumber of pages to skip, for paging through long lists; use the previous next_offset.

get_bot_api_definition Bot API method or type definition

Return the current definition of one Bot API method or type as structured data. Use it instead of reading the whole Bot API page when you need a method's parameters or a type's fields: each entry has its type, whether it is required, the description and any allowed values or length limits stated by Telegram, plus the changelog entries that mention it. For behaviour explained in prose elsewhere (formatting, payments, limits pages) use `search_telegram_docs` and `get_telegram_document`. Returns `kind` (method or type), `name`, `url`, `description`, then `params` (methods; with `returns`…

ParameterTypeDescription
name *stringExact Bot API method or type name, e.g. 'sendMessage', 'InlineKeyboardButton', 'ReplyParameters'. Case-insensitive; close matches are suggested.

check_bot_api_call Check a Bot API call

Check a Bot API request against the current official schema before running or shipping code. Reports errors (unknown method or parameter with suggestions, missing required parameters, wrong types, values outside the documented list, a wrong `type` in union objects such as InputMedia) and warnings (lengths outside documented limits, parameters retired in an older Bot API version with the changelog entry that replaced them, numbers or booleans sent as strings). It does not call Telegram and cannot check permissions, chat state or file contents. Returns `valid` (true when there are no er…

ParameterTypeDescription
method *stringBot API method name, e.g. 'sendMessage'.
params *objectThe request parameters exactly as your code sends them, as a JSON object. Nested objects such as reply_markup may be objects or JSON strings.

list_bot_api_changes Bot API changes by version

List official Bot API changelog entries as structured releases: version, date, link and the individual changes. Use it when upgrading a bot or a library ("what changed since 9.0?"), when a field seems new or missing, or to find when a method or field was added, replaced or removed. Returns `current_version` and `releases`, newest first: each has `version`, `date`, `url` and `changes` ({text, topic, refs: linked methods and types, terms: field and parameter names}). A name that no change mentions returns an empty list. For the full current definition use `get_bot_api_definition`; for T…

ParameterTypeDescription
limitintegerMaximum number of releases when since_version is empty.
namestringOnly changes that mention this method, type, field or parameter, e.g. 'InlineKeyboardButton' or 'reply_parameters'.
since_versionstringOnly releases newer than this Bot API version, e.g. '9.0'. Empty returns the latest releases.

check_telegram_project Check a bot project

Check every Bot API call in a Python bot project (aiogram, python-telegram-bot, pyTelegramBotAPI, raw HTTP requests) against the current official schema in one run. Use it after changing an existing bot, before an upgrade, or when asked to review a bot: it reads the whole project locally and returns only findings, so the documentation does not have to enter the context. Errors: values outside the documented list (for example `style="red"`), unknown methods or parameters in raw API requests. Warnings: parameters Telegram retired, with the Bot API version and changelog entry that re…

ParameterTypeDescription
path *stringAbsolute path to the bot project directory or a single Python file on this machine.
excludearrayGlob patterns relative to path to skip, e.g. ['tests/*', 'migrations/*'].
max_findingsintegerMaximum number of findings to return; totals always count everything.