Skip to main content
Glama
telegram-archive-mcp

telegram-archive-mcp

by GeiserX

Search every chat

search_all_chats
Read-onlyIdempotent

Search message text across all accessible Telegram chats in an archive, returning newest hits with chat identifiers for context lookup.

Instructions

Search message text across every chat this archive login may see, newest first. Matching is by word prefix on the viewer's full-text index. Each hit names its chat, and chat.ref is the chat_id for get_message_context or get_messages. Use search_messages instead to search one known chat. Needs a Telegram Archive viewer with cross-chat search; an older viewer answers 404.

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_all_chats"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum hits to return, 1 to 100 (default 20).
queryYesWords to find (e.g. "climbing gym address").
offsetNoHits to skip, 0 to 5000 (default 0).

Output Schema

NameRequiredDescriptionDefault
limitNo
queryNo
offsetNo
indexedNoFalse while the viewer is still building its search index, so hits may be missing.
resultsNoHits, newest first: id, date (naive UTC), text, sender_name, topic_title, matched_in, and chat {ref, title, type, ...}. chat.ref is the chat_id other tools take.
has_moreNoTrue when more hits follow; call again with offset + limit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.1

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds genuinely new behavior: prefix-based matching against the viewer's full-text index rather than substring, newest-first ordering, and a concrete failure mode (404 on older viewers). Those are traits an agent cannot infer from the annotations or schema.

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?

Four sentences, each carrying load: purpose and scope first, then matching semantics, then result shape, then the alternative and prerequisite. No filler and no repetition of the title or schema.

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 needn't be spelled out, yet the description still explains that chat.ref is the chat_id to feed into get_message_context or get_messages — the key chaining information. Ordering, matching semantics, prerequisite, and alternative are all present, leaving no ambiguity for a 3-parameter search tool.

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 limit/offset/query are already documented, establishing a baseline of 3. The description still adds semantic value about how the query parameter is interpreted (word-prefix matching, not substring) and about result ordering across pages. It says nothing extra about limit/offset interaction, but the schema handles that.

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 and resource ("Search message text across every chat") plus the precise scope ("this archive login may see") and ordering ("newest first"). It also names the sibling it is not — "Use search_messages instead to search one known chat" — so an agent can route without opening either 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?

Explicitly gives the selection rule against the closest alternative (cross-chat vs. one known chat) and names the alternative. It also states a prerequisite and failure mode: needs a viewer with cross-chat search, and "an older viewer answers 404."

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