Skip to main content
Glama

search_messages

Search Telegram chats by query with full-text or substring modes, filtering by chat, sender, and date range.

Instructions

Full-text search across all chats (or one chat). mode=fts uses stemmed Russian/English search with websearch syntax ("a b" phrase, -word exclusion, OR); mode=substring is a plain case-insensitive substring match.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNofts
limitNo
queryYes
chat_idNo
to_dateNo
from_dateNo
sender_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, this description carries the full burden of behavioral disclosure and does substantive work: it reveals the search modes, stemming behavior for Russian/English, and the websearch syntax capabilities (phrase, exclusion, implicit AND/OR). It doesn't disclose pagination or ordering behavior, but given the presence of an output schema payloadexplains return shape, and the description genuinely adds behavioral insight beyond a bare 'search messages' phrase.

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?

Two sentences, front-loaded with the primary purpose analysts, closely packed with both mode descriptions and the syntax variants. No filler; every clause adds value.

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?

For a search tool with an output schema present万里, the description adequately explains scope, modes, and syntax; the only minor gaps are lack of explicit mention of date/sender/chat filtering (though parameter names make those inferable) and no explicit 'when not to use' cross-reference to semantic_search.

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 very low (0%) – the schema only gives names/types/defaults, so the description must compensate internals. The description clarifies query semantics (fts vs substring), the effective scope of chat_id (all chats or one chat), and the websearch syntax applied to query. It does not explicitly explain from_date/to_date/sender_id semantics, but the core query/mode differentiation is well covered.

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 description opens with a clear verb phrase ('Full-text search across all chats (or one chat)') and immediately differentiates itself from siblings like semantic_search by naming the full-text nature and the two modes. It names the resource (messages/chats) and pins down scope (all chats or one chat), so an agent can distinguish it from semantic_search or message_context without opening the schema.

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?

It explains when to use each mode ('mode=fts uses stemmed Russian/English search with websearch syntax; mode=substring is a plain case-insensitive substring match'), which is explicit decision guidance between the two modes. It does not explicitly say 'use semantic_search for semantic similarity' but the mode breakdown is enough context for most selection cases; a small exclusion note about sibling tools would push it to 5.

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