Skip to main content
Glama
prabchevski

Telegram Search MCP

by prabchevski

Search one Telegram chat with filters

telegram_search_chat_messages
Read-onlyIdempotent

Find messages in a Telegram chat by text, sender, media type, date range, or topic. Filter by unread mentions, attachments, or voice notes to locate specific content.

Instructions

Search a known chat by text, sender, media type, dates, or forum topic.

Empty query allows attachment-only searches. sender_id is a positive user ID or negative chat ID. mention means unread mentions; voice includes video notes. Use timezone-qualified dates. Keep every filter unchanged when following cursor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
queryNo
cursorNo
chat_idYes
date_toNo
topic_idNo
date_fromNo
sender_idNo
media_typeNoall
unread_onlyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
next_cursorYes
scanned_countYes
trust_boundaryNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already establish the read-only, idempotent, non-destructive nature. The description adds non-obvious behavior: empty query means attachment-only search, sender_id can be a negative chat ID, 'mention' maps to unread mentions, 'voice' includes video notes, and cursor pagination requires all filters to remain unchanged. This substantially exceeds what annotations alone convey.

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 compact sentences, with the main purpose front-loaded and each subsequent sentence adding a distinct, high-value clarification. There is no filler or repetition of schema/annotation content.

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?

For a 10-parameter tool with zero schema descriptions, the description covers the non-obvious behaviors an agent must know to search correctly, especially edge cases and cursor semantics. The output schema and annotations cover return shape and safety, so nothing critical 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 description coverage is 0%, so the description must compensate, and it does for the trickiest parameters: query, sender_id, media_type, date/timezone handling, topic, and cursor. It does not explicitly explain limit or unread_only, but those are self-descriptive and visible in the schema defaults.

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?

The title and first sentence both specify a clear operation: search messages within a single known chat using filters. Enumerating text, sender, media type, dates, and forum topic distinguishes it from broader siblings like telegram_search_messages and simpler chat-history tools.

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 phrase 'Search a known chat' sets the precondition that a chat_id is already known, implying telegram_search_messages when the target chat is unknown. It gives concrete guidance on empty queries, sender_id sign conventions, media_type special cases, timezone-qualified dates, and cursor handling, though it never names a sibling explicitly.

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