Skip to main content
Glama
Automata MCP

Automata MCP

Search Telegram messages

search-telegram-messages
Read-onlyIdempotent

Search synced Telegram messages by keyword across all chats or one chat, newest first; case-insensitive matching requires every word in the message text or caption.

Instructions

[Telegram] Find synced Telegram messages containing given words, newest first, across every chat unless chatId narrows it to one. Matching is case-insensitive and every word must appear in the same message. Matches message text and media captions only, against the current wording of edited messages; deleted messages are not searchable. Only synced history is searched, so finding nothing is not proof a message does not exist — list-telegram-chats shows which chats have incomplete history. A match you sent is marked fromMe and carries no author. When truncated is true there were more matches than returned: narrow the search rather than reporting these as all of them.

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-telegram-messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoHow many matches to return
queryYesWords to look for. All of them must appear in the message.
sinceNoOnly messages at or after this date, e.g. 2024-03-01 or 2024-03-01T12:00:00Z
untilNoOnly messages at or before this date
chatIdNoRestrict to one chat, using a `chatId` from list-telegram-chats. Omit to search every chat.
fromMeNotrue for only messages you sent, false for only messages you received

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the read-only/idempotent annotations: case-insensitive AND matching, text and captions only, matches against current wording of edited messages, deleted messages excluded, and only synced history searched. It also explains the `fromMe`/`author` output shape and the meaning of `truncated`.

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?

Front-loaded with purpose and scope, and every clause carries information. It is a single dense block with long sentences, which slightly hurts scanability for a six-parameter tool.

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?

No output schema exists, yet the description explains the returned marks (`fromMe`, absent `author`), the `truncated` signal, and the limits of coverage. Nothing an agent needs to call or interpret results correctly is missing.

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 baseline is 3, but the description adds real meaning: the interaction between `limit` and `truncated` (more matches existed than returned) and the output-side effect of `fromMe`, which the schema does not state.

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?

Opens with a specific verb and resource ('Find synced Telegram messages containing given words'), plus scope ('newest first, across every chat') that separates it from read-telegram-messages and the generic search-messages sibling.

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?

Gives concrete usage context: omit `chatId` to search everything, narrow with `chatId`, and narrow rather than report a truncated set as complete. It also routes to list-telegram-chats for history completeness. It never explicitly contrasts with read-telegram-messages for non-search retrieval, so not a 5.

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