Skip to main content
Glama
LoneVertex

Telegram MCP — Next Generation

Search Local Offline SQLite Message Archive

search_cached_messages
Read-onlyIdempotent

Search locally cached Telegram messages without live API calls for rate-limit-free retrieval; sync chats first with sync_chat_cache.

Instructions

Search the local FTS5 SQLite archive for messages without making live Telegram API requests. Use for instantaneous, rate-limit-free search over synchronized messages. To sync messages into cache first, use sync_chat_cache.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of items or records to retrieve (integer between 1 and 100).
queryYesSearch text string or keywords to match against messages, contacts, or entities.
offsetNoPagination offset indicating the number of initial records to skip.
chat_idYesTarget Telegram chat, group, supergroup, channel, or user identifier. Accepts numeric chat ID (e.g. -1001234567890 or 123456789), username (e.g. '@channel'), or phone number.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.1.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds genuine behavioral context the annotations do not: no live API calls, no rate limits, and the dependency on previously synchronized messages. It doesn't mention staleness or what happens for unsynced chats, keeping it at 4.

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 core mechanism, then the benefit, then the prerequisite tool. Every sentence carries distinct information and nothing is repeated from 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 values need no explanation, and the description covers the key non-obvious dependency (sync first) and the offline/rate-limit behavior. It could go further on cache staleness or coverage limits, but for a 4-param read tool it is largely complete.

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 100%, with limit, offset, query, and chat_id all documented in the schema itself, so the baseline is 3. The description adds no extra meaning about query syntax (FTS5 matching rules) or pagination behavior beyond what the schema already says.

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 (Search) plus the exact resource and mechanism (local FTS5 SQLite archive), and contrasts it with live Telegram API requests, which separates it from siblings like search_messages and search_global. An agent can tell which search tool to reach for without opening a schema.

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 use condition (instantaneous, rate-limit-free search over synchronized messages) and names a concrete prerequisite alternative, `sync_chat_cache`, for populating the cache. It does not explicitly state when NOT to use it (e.g., fall back to live search_messages when the cache lacks a chat), so it stops short of full routing guidance.

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