Skip to main content
Glama
tgsearch-mcp

tgsearch-mcp

by schebotar

tg_search_index

Search a local SQLite FTS5 cache of Telegram messages for offline lookups, returning highlighted snippets and links; filter by chat and use prefix or raw FTS5 queries.

Instructions

Search the local FTS5 index built by tg_index_chat.

Works without network when chat is a numeric id or a known username. Returns highlighted snippets and links. This is a cache, not a substitute for server-side search over unindexed chats.

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": "tg_search_index"
  }
}

Input Schema

NameRequiredDescriptionDefault
chatNoLimit to one chat (ref or numeric id).
modeNoauto = safe prefix query, raw = raw FTS5 MATCH syntax.auto
limitNo
queryYesSearch query. The default mode treats words as prefixes and ANDs them.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden: it discloses offline capability, cache semantics, and that results are highlighted snippets with links, which is meaningful context beyond the schema. It omits error behavior when the requested chat is not indexed, staleness characteristics of the cache, and any note that the operation is a read-only lookup.

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?

Four short sentences with zero filler, front-loading what is searched before the network caveat and the cache disclaimer. Every sentence conveys information not present in the schema or annotations.

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?

An output schema exists, so return-format detail is not required, and the description still summarizes snippets and links. For a 4-parameter, annotation-less search tool it covers the important gotchas (offline conditions, cache caveat) but leaves limit/pagination and not-indexed behavior unexplained.

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 coverage is 75% (chat, mode, query documented; limit undocumented), so the baseline is 3. The description adds value only for `chat`, explaining that numeric ids and known usernames resolve offline; it says nothing about `limit` or how `mode=raw` changes results beyond what the schema already states.

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?

Names a specific verb and resource ('Search the local FTS5 index built by tg_index_chat') and clarifies it is a cache rather than a substitute for server-side search, which separates it from tg_search_global/tg_search_messages by category. It never names the sibling alternatives directly, so differentiation is directional rather than explicit.

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 concrete usage condition ('works without network when chat is a numeric id or a known username') and a when-not ('not a substitute for server-side search over unindexed chats'). No alternative tool is named, so an agent must infer that unindexed or fresh data requires the server-side search siblings.

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