Skip to main content
Glama

search_messages

Search full Telegram channel history for specific words across one or all configured channels, returning matching messages from a chosen time range.

Instructions

Find messages mentioning something across the configured Telegram channels.

Uses Telegram's own search, so it covers each channel's full history, not only what digests collected, and it matches words, not substrings or regexes. No AI tokens spent. Makes one Telegram request per channel: pass channel when you know where to look. Channel filters from config.yaml are not applied.

Args: query: Words to search for channel: Channel name or id as configured under channels[*]; all channels if omitted days: How many days back to search, 1 to 365 (default 30) limit: Maximum matches to return, 1 to 100, newest kept (default 30)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo
limitNo
queryYes
channelNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.7.4

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses Telegram-side search semantics (words, not substrings or regexes), that no AI tokens are spent, one Telegram request per channel, and that config.yaml channel filters are ignored. It omits auth/permission requirements and error or rate-limit handling.

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?

Purpose is front-loaded in the first sentence, followed by useful operational caveats and a compact Args block. The prose paragraph is slightly verbose relative to the four parameters but every sentence carries information.

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 read-only search tool with an output schema (so return values need no explanation), the description covers matching semantics, request cost, scope defaults, and the config-filter caveat. It is nearly complete, lacking only guidance on empty results or failure modes.

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 compensate and it does: it documents all four parameters, including valid ranges (days 1-365, limit 1-100), defaults, and the non-obvious 'newest kept' truncation rule for limit. This is meaningfully more than the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource with scope: 'Find messages mentioning something across the configured Telegram channels.' It also distinguishes itself from the digest tools by noting it covers each channel's full history rather than only digest-collected content. It does not explicitly contrast with get_channel_messages, the closest-looking sibling.

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 use ('Uses Telegram's own search, so it covers each channel's full history') and tells the agent when to narrow scope ('pass channel when you know where to look'). It stops short of naming an explicit alternative tool or a when-not-to-use condition.

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