Skip to main content
Glama

Edit message

edit_message
DestructiveIdempotent

Replace the text of an existing Telegram message sent by the authenticated account; only text can change, not media or other attributes.

Instructions

Replace the text of an existing message in a Telegram chat. Only works on messages sent by the authenticated account. Cannot edit media or other message attributes — text only. parse_mode: classic markdown/html/auto or rich (Rich Message; dialect auto-detected). schedule_date (ISO 8601) reschedules an already-queued message; it does not turn a delivered message into a scheduled one, and the result then carries status='scheduled'. Success: dict with message_id, date, chat, text, status='edited', and edit_date (rich messages also set rich=true and rich_format). Error: dict with ok=false and error string (e.g. message not found or not editable). Use edit_message to update a previously sent message; use send_message to create new ones. Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md

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": "<message>",
      "message_id": "<message_id>"
    },
    "name": "edit_message"
  }
}

Input Schema

NameRequiredDescriptionDefault
chat_idYesTarget chat: numeric id (e.g. -100…), username without @, or 'me' for Saved Messages.
messageYesMessage text. When sending files, used as caption.
message_idYesMessage id in this chat to edit (from get_messages or Telegram).
parse_modeNo'markdown'/'html'/'auto': classic entity formatting (auto detects). 'rich': Telegram Rich Message document; dialect auto-detected (known HTML tags outside code → rich HTML, else rich markdown). Default is 'auto'. parse_mode='rich' cannot be combined with files.auto
schedule_dateNoISO 8601 instant at which Telegram should deliver the message, e.g. '2026-10-20T09:00:00Z' or '2026-10-20T12:00:00+03:00'. Must be in the future. On send: queues the message instead of delivering now. On edit: reschedules an already-queued message.

Output Schema

NameRequiredDescriptionDefault
okNo
chatNo
codeNo
dateNo
richNo
textNo
errorNo
actionNo
paramsNo
senderNo
statusNo
topic_idNo
edit_dateNo
exceptionNo
operationNo
scheduledNo
error_codeNo
message_idNo
draft_savedNo
reply_to_idNo
rich_formatNo
reply_markupNo
schedule_dateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.46.1
    • addedInput schema / properties / schedule_date
      Added value: +{
      +  "default": null,
      +  "description": "ISO 8601 instant at which Telegram should deliver the message, e.g. '2026-10-20T09:00:00Z' or '2026-10-20T12:00:00+03:00'. Must be in the future. On send: queues the message instead of delivering now. On edit: reschedules an already-queued message.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "chat_id",
      -  "message_id",
      -  "message"
      -]New value: +[
      +  "chat_id",
      +  "message",
      +  "message_id"
      +]
    • addedOutput schema / properties / draft_saved
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / reply_to_id
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / schedule_date
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / scheduled
      Added value: +{
      +  "type": "boolean"
      +}
  2. Changed4 schema fields changedv0.45.0
    • changedInput schema / properties / parse_mode / description
      Previous value: -"'markdown', 'html', or 'auto' (detect from content). Default is 'auto'."New value: +"'markdown'/'html'/'auto': classic entity formatting (auto detects). 'rich': Telegram Rich Message document; dialect auto-detected (known HTML tags outside code → rich HTML, else rich markdown). Default is 'auto'. parse_mode='rich' cannot be combined with files."
    • changedInput schema / properties / parse_mode / enum
      Previous value: -[
      -  "markdown",
      -  "html",
      -  "auto"
      -]New value: +[
      +  "markdown",
      +  "html",
      +  "auto",
      +  "rich"
      +]
    • addedOutput schema / properties / rich
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / rich_format
      Added value: +{
      +  "type": "string"
      +}
  3. Changed3 schema fields changedv0.36.0
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / description
      Added value: +"Return type for ``send_message`` and ``edit_message``."
    • addedOutput schema / properties
      Added value: +{
      +  "action": {
      +    "type": "string"
      +  },
      +  "chat": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "code": {
      +    "type": "integer"
      +  },
      +  "date": {
      +    "type": "string"
      +  },
      +  "edit_date": {
      +    "type": "string"
      +  },
      +  "error": {
      +    "type": "string"
      +  },
      +  "error_code": {
      +    "type": "string"
      +  },
      +  "exception": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "message_id": {
      +    "type": "integer"
      +  },
      +  "ok": {
      +    "type": "boolean"
      +  },
      +  "operation": {
      +    "type": "string"
      +  },
      +  "params": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "reply_markup": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "sender": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "status": {
      +    "type": "string"
      +  },
      +  "text": {
      +    "type": "string"
      +  },
      +  "topic_id": {
      +    "type": "integer"
      +  }
      +}
  4. First observedv0.21.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and openWorldHint=true; the description adds the practical consequences: the existing text is replaced (irreversible loss of prior content), only own messages are editable, and failures return ok=false with an error string such as 'message not found or not editable'. The success/return-shape sentence is largely redundant given a dedicated output schema exists, which keeps it from 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?

Front-loaded with the core action and constraints, and the alternative-tool routing is placed at the end where it reads as a decision rule. It is dense but nearly every clause carries information; the enumerated return/error dict contents and the documentation URL are the only mildly expendable parts.

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?

Given a full output schema, complete annotation coverage, and 100% parameter documentation, the description supplies exactly the missing layer: scope limits, edit-specific scheduling semantics, and the routing rule versus send_message. Nothing an agent needs to call this correctly is absent.

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 coverage is 100%, so the schema already documents chat_id, message, message_id, parse_mode, and schedule_date in detail. The description's parse_mode and schedule_date notes restate what the schema says (rich dialect auto-detection, reschedule-on-edit), adding little new meaning beyond the edit-specific framing. Baseline 3 is appropriate when the schema does the heavy lifting.

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 and resource ('Replace the text of an existing message in a Telegram chat') and immediately bounds scope ('only works on messages sent by the authenticated account', 'text only'). It also names the sibling it is not (send_message) so an agent can route without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use ('Use edit_message to update a previously sent message') and when-not ('use send_message to create new ones'), plus hard exclusions: cannot edit media or other message attributes, cannot edit messages from other accounts. The schedule_date caveat ('does not turn a delivered message into a scheduled one') is a real usage trap that is called out directly.

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