Skip to main content
Glama

Search messages

search_messages
Read-only

Search archived Telegram messages and file names by keyword, then filter by chat, sender, date, or media to find relevant conversations and open specific messages.

Instructions

Keyword search over all archived messages and file names, newest first, grouped by chat. Returns message ids to open with get_messages(around_message_id=...).

query: 1 to 3 distinctive words; every word must match, as a prefix ("audit" also finds "audits"). If no message has all words, messages with any of them are returned. Use "quoted phrases" and OR for alternatives (launch OR release). Not semantic: search for words the messages would contain, not for the question. chat: chat id, @username or part of a title. sender: part of a sender name or username. since/until: "24h", "7d", "2026-09-01" or an ISO timestamp. media: only messages with an attachment: "files" (photos, videos, documents, voice, audio), "any", or one of photo, video, document, voice, audio, sticker, poll, link.

Input Schema

NameRequiredDescriptionDefault
chatNo
limitNo
mediaNo
queryYes
sinceNo
untilNo
senderNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered; the description adds real behavioral detail beyond them — ordering (newest first), grouping by chat, and the prefix-matching fallback ('if no message has all words, messages with any of them are returned'), which changes how results should be interpreted. It does not mention the limit default of 20 or truncation behavior, keeping it below a 5.

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?

Dense two-block structure: a summary sentence with the return path first, then a parameter glossary. Every clause carries actionable information with no filler or repetition of the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return values needn't be explained, and the description still adds ordering, grouping, and the message-id linkage. Missing are pagination/limit behavior and result count behavior, minor but relevant for a 7-parameter search tool.

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

Parameters5/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 carry all parameter meaning, and it does: query prefix-matching/quoting/OR semantics, chat accepting id/@username/title fragment, sender as partial name, since/until formats ('24h', '7d', ISO), and the media enum values. Only limit is left undocumented.

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?

Specific verb+resource+scope: 'Keyword search over all archived messages and file names, newest first, grouped by chat.' It also explains the output shape and routes the agent to get_messages(around_message_id=...) for opening a hit, which distinguishes it from list_chats/get_messages/recent_activity.

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 states when this applies and when not: 'Not semantic: search for words the messages would contain, not for the question.' It names the follow-up tool and the exact parameter for drill-down, so an agent knows both entry and next step.

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