Skip to main content
Glama
tgsearch-mcp

tgsearch-mcp

by schebotar

tg_index_chat

Build or incrementally update a local SQLite FTS5 index for one Telegram chat so you can search large message histories repeatedly without refetching everything.

Instructions

Build or update the local SQLite FTS5 index for one chat.

Incremental by default: only messages newer than the indexed maximum are fetched. Use it for large histories you query repeatedly, then search it instantly with tg_search_index. On FloodWait the response carries stopped.retry_after; re-run later to continue.

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_index_chat"
  }
}

Input Schema

NameRequiredDescriptionDefault
chatYesChat reference: @username, t.me link, or numeric chat id.
limitNoMax history messages to scan in this call.
resetNoDrop the existing local index for this chat first.
since_idNoIndex only messages newer than this id.

Output Schema

NameRequiredDescriptionDefault

No arguments

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, the description carries the full disclosure burden and does substantial work: it explains the incremental default, the destructive effect of reset is implied by the schema but the incremental/full distinction is spelled out, and it surfaces the FloodWait partial-failure contract with `stopped.retry_after` plus a resume instruction. It omits local storage cost, auth requirements, and whether a partial index remains queryable after a stop, which keeps it below a 5.

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?

The purpose and the incremental default are front-loaded, and each following sentence covers a distinct operational fact (workflow, FloodWait recovery). Slightly choppy line-wrapping but no filler sentences.

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

Completeness5/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, yet the description still calls out the one return-value detail that matters operationally (`stopped.retry_after`). Combined with the incremental semantics and the sibling handoff, nothing an agent needs to call this correctly is missing.

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 100%, so the baseline is 3; the description earns above that by explaining the default mode — only messages newer than the indexed maximum are fetched — which gives concrete meaning to how since_id and limit interact with existing index state.

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 specific verb and resource — "Build or update the local SQLite FTS5 index for one chat" — and explicitly names tg_search_index as the downstream consumer, making it distinguishable from search siblings.

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 states the intended scenario ("large histories you query repeatedly") and pairs the tool with tg_search_index, so an agent knows the build-then-query workflow. It stops short of an explicit when-not or a pointer to a cheaper alternative for one-off lookups.

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