Skip to main content
Glama
tgsearch-mcp

tgsearch-mcp

by schebotar

tg_search_messages

Find messages in one Telegram chat via server-side full-text search with filters for type, sender, date, or topic; results include snippets and a next-page cursor.

Instructions

Server-side full-text search inside one chat - the fast path for "find X in this channel". Results are newest first, with snippet, link and a next_offset_id cursor. For context around a hit use tg_get_messages with around_id.

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": {
      "chat": "<chat>"
    },
    "name": "tg_search_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
chatYesChat reference: @username, t.me link, or numeric chat id.
kindNoMessage type filter.any
limitNo
queryNoText query. Empty is allowed only with kind or topic_id.
senderNoOnly messages from this @username or user id.
max_dateNoISO date or unix timestamp; a date-only value means end of day.
min_dateNoISO date (2025-01-31) or unix timestamp.
topic_idNoForum topic id.
offset_idNoCursor: return messages older than this id.
max_text_charsNoMaximum characters of message text per message.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

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 disclose real behavior: execution is server-side, results are newest-first, and each result carries a snippet, link and a `next_offset_id` cursor for pagination. It omits auth requirements, rate limits, or what happens when no results match, but the core operational traits are covered.

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?

Three short sentences, front-loaded with the primary capability and scope before the follow-up routing hint. Every sentence adds information; nothing is redundant with the name or 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?

For a 10-parameter search tool with an output schema and high schema coverage, the description supplies the essential context: scope, result ordering, result shape, and pagination cursor. Missing are any notes on result caps or empty-query edge cases, but those are partially covered by the schema defaults.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 90%, so parameter meaning is already largely documented in the schema and baseline 3 applies. The description only touches parameter semantics indirectly via the `next_offset_id` cursor, without clarifying query syntax, date handling, or how `kind` interacts with an empty query.

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?

States a specific verb and resource ('Server-side full-text search') and bounds the scope explicitly ('inside one chat'), which separates it from the sibling global/index search tools by implication. It also names the concrete agent intent it serves ('find X in this channel'), so the tool's role is unambiguous.

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 a clear selection rule for the fast-path case and routes to a named alternative ('for context around a hit use tg_get_messages with around_id'), including the specific parameter to use. It stops short of saying when not to use this tool (e.g. cross-chat search), so no explicit exclusion is stated.

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