Skip to main content
Glama
mcp-telegram-agent

mcp-telegram-agent

get_updates

Fetches pending Telegram updates once without waiting—messages, button clicks, and poll answers—with optional read-offset control and automatic callback answering.

Instructions

Fetch pending user updates (messages, button clicks, poll answers) once without waiting.

一次性拉取待處理的更新並歸一化回傳,不等待新訊息。
chat_id 未傳時使用 TELEGRAM_DEFAULT_CHAT_ID;未設定白名單時回傳設定提示。
types 可選 message、callback_query、poll_answer,預設全部。
mark_read=False 時不移動 offset,同一批訊息下次仍會回傳(預設會讀取並推進)。
auto_answer=True(預設,僅 mark_read=True 時生效)時,回傳的 callback_query
會當下立即以通用提示應答,payload 標記 auto_answered=True,消除取回後
手動應答超過有效窗口(query is too old)的競態;應答失敗時改標記
auto_answer_error,不影響更新回傳。需要自訂提示文字、show_alert 或 url
時設 auto_answer=False,改以 answer_callback_query 手動應答。
limit 只限制單次回傳筆數:offset 僅推進到實際回傳的最後一筆,
截斷的其餘符合項目會留待下次呼叫(因此其應答也延後到下一頁取回時);
無符合項時整批消耗(含白名單外與 types 以外的更新)以免積壓堆積——
offset 為單一串流,無法單獨保留某個型別或某間聊天室的更新。
注意:首次呼叫(尚無狀態檔)時 Telegram 會回傳全部未確認的 pending
updates,且 mark_read 預設 true 會將其讀取推進;若不想消耗歷史積壓,
第一次呼叫請先以 mark_read=False 預覽。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_updates"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
typesNo
chat_idNo
mark_readNo
auto_answerNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.1

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and discharges it: it discloses offset advancement semantics, that truncation defers the remaining items (and their acknowledgements) to the next page, that no-match batches are fully consumed, the TELEGRAM_DEFAULT_CHAT_ID fallback, whitelist hints, and the auto_answered / auto_answer_error payload markers. The 'query is too old' race condition and how auto-answering prevents it is exactly the kind of behavior annotations could never supply.

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 English summary is front-loaded and the detailed caveats follow in a logical order, with every clause doing real work. It is nonetheless dense and long, and the split between English summary and Chinese detail means an agent must read the whole block to recover all parameter rules.

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?

An output schema exists so return values need not be explained, yet the description still names the payload markers an agent must inspect. For a five-parameter, stateful polling tool with default-mutating behavior, nothing needed for a correct first call is missing.

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 compensate, and it does for all five parameters: limit is scoped as a per-call return cap that does not advance offset past returned items, types is enumerated with its default, chat_id has a documented fallback, mark_read has an explicit default and side effect, and auto_answer has both a default and a conditional-activation rule (only with mark_read=True).

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 opening sentence gives a specific verb and resource (fetch pending user updates) and enumerates the payload kinds (messages, button clicks, poll answers), with 'once without waiting' implicitly marking it off from the sibling wait_for_reply. An agent can identify the tool's role without reading 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 Guidelines5/5

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

It gives explicit decision rules: use mark_read=False on a first call to preview instead of consuming the historical backlog, and set auto_answer=False plus call answer_callback_query manually when custom text, show_alert, or url is needed. A named alternative and the exact condition that selects it are both present.

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