Skip to main content
Glama

Search Telegram and TON docs

search_telegram_docs
Read-onlyIdempotent

Search official Telegram and TON documentation for API, bot, Mini App, TDLib, or library questions before coding. Returns matching sections with URLs and offsets for verification.

Instructions

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 exist; if the cache is empty, the response suggests pages to fetch.

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": {
      "query": "<query>"
    },
    "name": "search_telegram_docs"
  }
}

Input Schema

NameRequiredDescriptionDefault
areaNoLimit results to one documentation area; empty searches all areas. Core Telegram docs rank above library docs unless the query names a library.
limitNoMaximum number of matching sections to return.
queryYesExact 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 (кнопка, кружок, кошелек) are expanded automatically.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.6.1
    • addedInput schema / properties / area / description
      Added value: +"Limit results to one documentation area; empty searches all areas. Core Telegram docs rank above library docs unless the query names a library."
    • addedInput schema / properties / area / enum
      Added value: +[
      +  "",
      +  "bot-api",
      +  "mini-apps",
      +  "telegram-api",
      +  "tdlib",
      +  "releases",
      +  "product-releases",
      +  "gateway",
      +  "web-integrations",
      +  "media-design",
      +  "ton",
      +  "ton-releases",
      +  "aiogram",
      +  "python-telegram-bot",
      +  "grammy"
      +]
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of matching sections to return."
    • addedInput schema / properties / limit / maximum
      Added value: +20
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • addedInput schema / properties / query / description
      Added value: +"Exact 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 (кнопка, кружок, кошелек) are expanded automatically."
    • addedInput schema / properties / query / minLength
      Added value: +1
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare read-only/idempotent/open-world, so the description focuses on genuinely new behavior: result fields (page URL, heading, excerpt, document_offset, freshness), the fact that excerpts are partial, that stale pages are re-fetched before matching, and that an empty result is not proof of absence with cache suggestions. This is substantive disclosure beyond the 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?

Front-loaded with the core purpose, followed by usage scope, then return shape, then caveats in descending order of importance. Every sentence — including the partial-excerpt warning and the empty-result caveat — earns its place with no filler.

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?

No output schema exists, and the description compensates by enumerating the returned fields and warning that excerpts are partial and must be verified via get_telegram_document. Combined with the cache-empty fallback note, an agent has everything needed to call and interpret this tool correctly.

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 description coverage is 100%, so the schema already documents query, area, and limit thoroughly — including the very query examples and Russian-word expansion the description repeats. The description adds only a passing mention that results are capped at `limit`; baseline 3 applies when the schema carries the parameter burden.

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?

Uses a specific verb ("Find") with a specific resource ("official documentation sections") scoped to Telegram/TON development questions. It also distinguishes itself from the sibling get_telegram_document by casting itself as the discovery step and that tool as the follow-up.

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

Usage Guidelines5/5

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

Explicitly states when to use it ("before writing or reviewing code" that calls Bot API, Mini Apps JS, MTProto, TDLib, TON Connect, Tolk, aiogram, python-telegram-bot, grammY) and names the alternative path — open the page with get_telegram_document at document_offset when details matter. The when-to-use vs. when-to-escalate boundary is fully spelled out.

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