Skip to main content
Glama

telegram_archive_search

Read-onlyIdempotent

Search archived Telegram messages with regular expressions, sender IDs, or date ranges that Telegram's own text-only search cannot match; results come from the archive, not live.

Instructions

Costs no Telegram request at all, which is what makes regular expressions, sender filters and date ranges possible — Telegram's own search matches text only. Use when the user wants a regular expression, a sender, or a date range over messages already archived. Do not use this for a live Telegram search; call telegram_search, or telegram_archive_sync first when the chat is not archived. Every result is checked against the current read policy for its own chat, so a chat archived while it was permitted and closed since is withheld and counted. The answer always carries meta.source: archive and the timestamp of the oldest sync it covers: an archive result mistaken for a live one is stale state reported as current.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatNoRestrict to one archived chat. Omit to search every archived chat this policy still permits.
limitNoMatching messages to return.
queryYesSubstring, or a regular expression.
regexNoTreat `query` as a Python regular expression instead of a substring. This is what a live search cannot do: Telegram matches text, not patterns.
sinceNoOnly messages at or after this ISO-8601 timestamp.
untilNoOnly messages at or before this ISO-8601 timestamp.
senderNoOnly messages from this sender id.
accountNoAccount label to use. Omit when exactly one account is configured.
ignore_caseNoMatch without regard to case.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations (readOnly/idempotent/non-destructive), it discloses non-obvious behavior: no Telegram request is consumed, every result is re-checked against the *current* read policy so revoked chats are withheld and counted, and the answer carries meta.source: archive plus the oldest sync timestamp. It also warns about the stale-state failure mode, which no annotation conveys.

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 key differentiator (no request cost), then usage, then anti-usage, then the policy and metadata guarantees. Five sentences, each carrying distinct information 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?

With no output schema, the description compensates by describing the response envelope (meta.source: archive, oldest covered sync timestamp) and the withholding/counting behavior. For a 9-parameter read tool, an agent has everything needed to call it correctly and interpret results.

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 100%, so the baseline is 3; the description still adds meaning by explaining that the archive's zero-request design is precisely what makes regex, sender filters, and date ranges possible, and why regex is unavailable live. It does not add detail on chat/limit/ignore_case, but those are adequately covered by 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 states a specific verb and resource — search over already-archived Telegram messages — and explicitly positions itself against the live-search sibling. An agent can distinguish it from telegram_search and telegram_archive_sync without opening any 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 when-to-use (regex, sender, or date range over archived messages), explicit when-not-to-use ('Do not use this for a live Telegram search'), and names the alternatives (telegram_search, or telegram_archive_sync first when the chat is not archived). Routing is fully specified.

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