Skip to main content
Glama
Telegram MCP Server

Telegram MCP Server

by lyduchuy1204

search_messages

Read-only

Search Telegram messages by text in one chat or across all chats when chat is omitted. Use it to find specific content or references.

Instructions

Search messages by text in one chat, or across all chats when chat is omitted.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
chatNo
limitNo
queryYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety and scope are covered structurally. The description adds the meaningful behavioral detail that omitting `chat` broadens the search to all chats. It does not disclose result ordering, matching semantics, or truncation behavior when the default limit is hit.

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?

A single sentence with no filler, and the most decision-relevant constraint (chat omitted scopes to all chats) is front-loaded. It is lean to the point of omitting two of three parameters, but nothing written is wasted.

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

Completeness3/5

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

An output schema exists, so return values need not be described. But for a three-parameter search tool with zero schema description coverage, the description leaves `limit` and query matching behavior completely unaddressed, which leaves the agent guessing about result set size and match rules.

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

Parameters2/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 parameter meaning. It explains only the `chat` parameter's null-versus-value behavior; `limit` is never mentioned and `query` matching semantics (substring, case sensitivity, full-text) are left undefined.

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?

The description names a specific verb ("Search") and resource ("messages") with an explicit scope rule: one chat when provided, all chats when omitted. This distinguishes it from read_messages and list_chats, though it does not name those siblings directly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The condition for the cross-chat behavior is stated clearly, which implicitly tells the agent when to omit `chat`. However, there is no guidance on when to prefer this over read_messages or list_chats, and no stated exclusions or prerequisites.

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