Skip to main content
Glama
telegram-archive-mcp

telegram-archive-mcp

by GeiserX

Read around a message

get_message_context
Read-onlyIdempotent

Retrieves the conversation around a specific message, returning older and newer messages from the same chat so you can understand replies and see the full context of a search hit.

Instructions

Read the conversation around one message: the message itself with up to before older and after newer messages of the same chat, oldest first. Use it after search_messages or search_all_chats finds a hit, or to see what a reply_to_msg_id points at.

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_id": "<chat_id>",
      "message_id": "<message_id>"
    },
    "name": "get_message_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
afterNoNewer messages to include, 0 to 50 (default 5).
beforeNoOlder messages to include, 0 to 50 (default 5).
chat_idYesThe chat's ref, as list_chats or search_all_chats returns it (an opaque string; not the numeric Telegram id).
message_idYesId of the message to centre on (a message's id field).

Output Schema

NameRequiredDescriptionDefault
afterYesHow many newer messages came back (fewer than asked at the end of the chat).
beforeYesHow many older messages came back (fewer than asked at the start of the chat).
messagesYesOldest first: the older messages, the message itself, then the newer ones, with the same fields as get_messages.
message_idYesThe message asked for; it is in messages.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds useful behavioral context: the result includes the centered message, up to before/after neighbors, same-chat scope, and oldest-first ordering.

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?

Two sentences, front-loaded with the core behavior and followed by concrete usage guidance. There is no redundant or filler text.

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?

The tool has rich annotations, a complete input schema, and an output schema, so the description need not explain return values in detail. It still covers the essential composition and ordering of the returned context, which is sufficient for correct invocation.

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%, so before, after, chat_id, and message_id are already well documented. The description reinforces before/after and same-chat scope but adds little parameter detail beyond the schema, making the baseline 3 appropriate.

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 states a specific verb and resource: read the conversation around one message, including the message itself plus older and newer messages from the same chat. It also specifies ordering (oldest first), which makes the tool's output shape clear and distinguishes it from broad message-listing 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 explicitly says to use this after search_messages or search_all_chats finds a hit, and to inspect what a reply_to_msg_id points at. That gives clear triggering contexts, though it does not explicitly exclude cases where get_messages might be preferred.

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