Skip to main content
Glama

Search message archive

tg_search_archive
Read-only

Search already indexed Telegram messages offline by full text, with chat, date, and field filters; index a chat first so all its messages become searchable without contacting Telegram.

Instructions

Full-text search over messages the service has already read or indexed (titles, versions, passwords, descriptions) WITHOUT contacting Telegram. Use tg_index_chat on a chat to archive all of its messages.

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": "tg_search_archive"
  }
}

Input Schema

NameRequiredDescriptionDefault
chatsNo
limitNo
queryYes
sinceNo
untilNo
fieldsNoKeep only these fields in list items (e.g. ["message_id","name","size"])
formatNocompact = lists as {columns, rows} tables; saves a lot of context for long listingsjson
accountNoAccount id (see tg_list_accounts). Defaults to the default account.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare read-only and non-destructive behavior, so the safety profile is covered. The description adds meaningful context beyond annotations: it operates only on locally indexed content, makes no Telegram calls, and searches titles, versions, passwords, and descriptions. It does not disclose pagination behavior or result ordering, but it adds real behavioral context.

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?

Two sentences, front-loaded with the capability and its key constraint, followed by a direct prerequisite pointer. There is no filler and every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is enough to understand the purpose, the offline constraint, and the indexing prerequisite. However, for an 8-parameter search with no output schema and low schema description coverage, it leaves important operational details like date filtering, limit semantics, and result shape unclear.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 38%, so the description needs to compensate. It does not explain the chats, since, until, limit, or query parameters; it only notes the content types searched, leaving date formats, matching semantics, and limit behavior unspecified.

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?

States a specific verb ('Full-text search') and resource ('messages the service has already read or indexed'), and distinguishes itself from live Telegram access by emphasizing it works WITHOUT contacting Telegram. It also names tg_index_chat as the way to extend the archive, giving the agent a clear mental model of the tool's niche.

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

Usage Guidelines4/5

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

The description gives a crucial prerequisite: use tg_index_chat on a chat to archive its messages. That tells the agent when the tool is applicable and what to do if the archive is empty. It does not explicitly say when to use this versus live-search siblings like tg_search_messages, so it falls short of full when/when-not guidance.

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