Get bounded Telegram message context
telegram_get_contextReads up to five supported neighboring messages on each side of a Telegram message to provide surrounding chat context; use exact chat and message IDs.
Instructions
Read an anchor and up to five supported neighboring messages on each side.
Use the exact native chat/message pair from another Telegram MCP result. before and after exclude the anchor; zero omits that side. The anchor must have supported text. Results can be shorter near history boundaries or when nearby messages have no supported text; text is capped at 4,000 characters. This is surrounding chat context, not a reply-thread listing: use telegram_get_message_thread for that. No read acknowledgement is sent.
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": "telegram_get_context"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | Supported neighboring messages on this side of the anchor, excluding the anchor; 0 omits this side, maximum 5. | |
| before | No | Supported neighboring messages on this side of the anchor, excluding the anchor; 0 omits this side, maximum 5. | |
| chat_id | Yes | Exact native chat_id returned by telegram_list_chats or message/search results. Keep its sign; pass the ID, not a title, @username or Telegram link. | |
| message_id | Yes | Exact positive native TDLib message_id from a Telegram MCP result in the specified chat. Reuse the chat/message pair unchanged; do not convert Bot API IDs or IDs from Telegram URLs. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | ||
| messages | Yes | ||
| anchor_chat_id | Yes | ||
| trust_boundary | No | ||
| anchor_message_id | Yes |