Skip to main content
Glama
LoneVertex

Telegram MCP — Next Generation

Search Messages Within Specific Chat

search_messages
Read-onlyIdempotent

Find text keywords within a specific Telegram chat or supergroup. Retrieve matching past messages by chat ID and query, with an optional result limit.

Instructions

Search for text keywords within a specific Telegram chat or supergroup. Use when finding past conversations in a single chat. To search globally across all public channels, use search_global. To search the offline cache without live Telegram API calls, use search_cached_messages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of items or records to retrieve (integer between 1 and 100).
queryYesSearch text string or keywords to match against messages, contacts, or entities.
accountNoOptional account label for multi-account environments. If omitted in single-mode, the default account is used. In multi-mode without an account, read-only tools fan out across all configured accounts.
chat_idYesTarget Telegram chat, group, supergroup, channel, or user identifier. Accepts numeric chat ID (e.g. -1001234567890 or 123456789), username (e.g. '@channel'), or phone number.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.1.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld, non-destructive, so the safety profile is covered. The description adds genuinely new context by implying live Telegram API calls (contrasted with the cache-only sibling). It stops short of disclosing rate limits, pagination, or empty-result behavior, so it is strong but not exhaustive.

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?

Three short sentences, zero filler: capability first, usage second, alternatives third. Every sentence carries information an agent needs before choosing the 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?

Output schema exists so return values need not be explained, annotations carry the safety profile, and the schema fully documents parameters. The routing information the description supplies is exactly the missing piece, leaving nothing an agent needs absent.

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

Parameters3/5

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

Schema description coverage is 100%, so all four parameters (limit, query, account, chat_id) are already documented with examples and defaults. The description adds no syntax, format, or matching-behavior detail beyond the schema, which is the baseline expectation at this coverage level.

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 ('Search for text keywords'), an explicit resource scope ('within a specific Telegram chat or supergroup'), and contrasts itself with two named siblings. An agent can distinguish it from search_global and get_messages 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?

Names the exact scenario ('finding past conversations in a single chat') and then routes the agent to two alternatives with their selecting conditions: global public channel search versus offline cache search. When-to-use and when-to-use-something-else are both explicit.

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