Skip to main content
Glama

Search Telegram messages

telegram_search_messages
Read-onlyIdempotent

Full-text search over archived message text and captions. The last word is prefix-matched. Optionally restrict to one chat or to a time window. Messages include is_forwarded and forward_origin (original author/channel and Unix date when available). For forwards, from identifies who forwarded it in this chat, not the original author. Missing origin data does not prove authorship; never infer a hidden author's identity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoHow many matches to return. Default 30.
queryYesWords to search for.
sinceNoOnly messages at or after this time. Accepts an ISO 8601 timestamp, unix seconds, 'today', 'yesterday', or a relative window like '24h' / '7d'.
chat_idNoRestrict the search to this chat.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/non-destructive, but the description goes well beyond them: it explains the prefix-match rule on the last word, the semantics of is_forwarded/forward_origin, and the crucial caveat that 'from' on a forward is the forwarder, not the original author. It even warns against inferring hidden authorship from missing origin data — high-value 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core search behavior, then the forwarding caveat. Every sentence carries information, though the forwarding discussion is dense and could be slightly tightened.

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, and the description compensates by naming the returned fields (is_forwarded, forward_origin, from) and their interpretation. For a read-only search tool with full schema coverage, nothing an agent needs to invoke it 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 the baseline is 3, but the description adds genuine meaning beyond the schema: the last-word prefix-matching behavior of the query parameter and the optionality of chat/time restrictions. It does not elaborate on limit or the accepted time formats, which the schema already handles.

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+resource (full-text search over archived message text and captions) and immediately narrows scope with prefix-matching and optional chat/time-window restriction. This clearly separates it from sibling listing tools like telegram_get_messages and telegram_recent_messages.

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 clear context for when this tool applies — free-text lookup with optional chat or time-window narrowing — which tells an agent when search is appropriate versus retrieving recent messages. It stops short of explicitly naming an alternative or stating when-not to use it, so it lands just below the top band.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources