Skip to main content
Glama
draiqw
by draiqw

tg_index

Destructive

Create a local full-text index of selected Telegram chats to enable offline search. Sync updates the index, status shows indexed content, and drop removes it.

Instructions

Local full-text index of the correspondence, for tg_search(engine="local").

Nothing is indexed on its own — only the chats the owner names here. The index is a plain-text copy of those chats in the project's data/index.db (mode 600); action="drop" deletes it.

Args: action: "sync" — fetch and index (incremental: only what appeared since last time, so calling it again is cheap); "status" — what is indexed, how many messages, when, file size; "drop" — delete the whole index, or only the named chats. chats: which chats to sync or drop, up to 25. On sync, omitting them refreshes everything already in the index; the first sync of a chat must name it. since: how deep to go on the first pass — "today" or an ISO date. limit: how many messages per chat to pull in this call (default 2000, max 20000). Passing it also means "go deeper", not just "catch up".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatsNo
limitNo
sinceNo
actionNosync

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

The description goes well beyond the annotations: it discloses that the index is a plain-text copy stored in data/index.db with mode 600, that action="drop" deletes it, that sync is incremental and cheap on repeat, and that the first sync of a chat must name it. This gives the agent an accurate mental model of side effects, storage, and destructive behavior. It is fully consistent with destructiveHint=true and idempotentHint=false.

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?

The description is dense but every sentence earns its place. It front-loads the core purpose in one line, then provides a compact warning about indexing scope, then a clearly labeled arg list. The structure makes it easy for an agent to scan actions and parameter semantics without wading through filler.

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?

For a tool with four parameters, no output schema, and destructive potential, this description covers the essentials: what the index is, where it lives, how each action behaves, parameter constraints, and even the return shape for 'status'. Nothing critical is missing for an agent to select and invoke the tool correctly.

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 carries the full burden, and it succeeds. It explains every parameter: action and its three enumerated behaviors, chats with the 25-chat limit and omission semantics, since with allowed formats ('today' or ISO date), and limit with default, max, and the 'go deeper' meaning. This is far richer than the bare schema.

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 first sentence states the resource precisely: 'Local full-text index of the correspondence, for tg_search(engine="local")'. It immediately orients the agent to what this tool manages and how it relates to a sibling tool. The arg list then clarifies the concrete operations (sync, status, drop), removing any ambiguity.

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?

The description gives clear context: the tool indexes only explicitly named chats, it is for local search, and the action values define distinct use cases. It also states an important precondition ('the first sync of a chat must name it'). However, it does not explicitly say when not to use this tool or point to alternative tools beyond mentioning tg_search.

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