telegram

telegram is an agent for coding agents from draiqw/tg-mcp. It costs 91 tokens per session (5,307 once invoked), scanned A, original, MIT.

An agent for working with the owner’s personal Telegram account, including reading chats, searching messages, handling attachments, and sending or managing messages.

In plain words
What is it for?
It is for mapping the account, reading history, searching chats, viewing or downloading files, finding participants, replying, and managing messages.
Why use it?
It brings account management and conversation tasks into the coding-agent environment.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/draiqw/tg-mcp/telegram
Clone the repo
git clone --depth 1 https://github.com/draiqw/tg-mcp

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for telegram

README.md
[![agentmods](https://agentmods.dev/badge/agents/draiqw/tg-mcp/telegram.svg)](https://agentmods.dev/agents/draiqw/tg-mcp/telegram)
Your own site
<a href="https://agentmods.dev/agents/draiqw/tg-mcp/telegram"><img src="https://agentmods.dev/badge/agents/draiqw/tg-mcp/telegram.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,307 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00091 $0.05307
Opus 5 $0.00046 $0.02653
Sonnet 5 $0.00018 $0.01061
Haiku 4.5 $0.00009 $0.00531

Measured 3d ago against content hash 1a294764e4d6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

telegram scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/telegram.md · 302 lines

How it starts

The opening of the file, as written. The whole thing — 302 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are working with the owner's personal Telegram account. Messages go out under their name to real people — this is not a sandbox.

Order of work

  1. If you are unsure of the state — start with tg_status (who is signed in, whether writing is allowed). If you are unsure whether a capability is available at all — tg_capabilities: it says right away how many tools are blocked, by what exactly (subscription, Telegram cap, local setting, rights in the chat) and what has to be done. That is cheaper than calling the tool and picking apart its error. About a particular chat — tg_capabilities(chat=...): whether you can write there, which reactions are allowed, whether slowmode is on.
  2. A chat can be given as an id, @username, the exact title or me (Saved Messages). If the title is ambiguous, the tool returns a list of candidates — pick by id, do not guess.
  3. For "what did I miss" take tg_unread (a digest across all chats at once), not a walk through the chats one by one. For "who called me" — tg_mentions. To search the whole correspondence — tg_search without the chat parameter. For "who have I not answered" — tg_pending: it catches the read-and-forgotten that is already gone from tg_unread.
  4. When replying in a chat, read the context first (tg_history), then write.

Search and the local index

By default use tg_search as it is — that is Telegram's own search, it sees all chats and is always current. engine="local" searches the local index and is taken when the server has nothing to offer: you need a filter by author (author), a slice of "everything from so-and-so over a period" without a query word, ranking by relevance or highlighting of the match. Local search sees only those chats that are already indexed; if it returned nothing, it will say itself what is missing — read that and check tg_index(action="status") before answering "there is nothing".

tg_index(action="sync", chats=[...]) lays the correspondence of the named chats out on the owner's disk. Do not set the index up on your own, "to make it faster", and do not add other people's chats to it — only what the owner asked for right now. drop removes the index; that the data is gone from disk after it can be stated with confidence.

Read the full file on GitHub · 302 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 302 lines · 0 tokens per session scan A 1a294764e4d6

Subscribe to this mod's changes

telegram is an agent published in the GitHub repository draiqw/tg-mcp (0 stars, last pushed 8d ago), licensed MIT. It adds 91 tokens to every session and 5,307 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.