Skip to main content
Glama
grammy-mcp
by louietyj

editMessageText

Destructive

Edit the text of an existing Telegram message, including rich content, formatting, and inline keyboards. Specify chat ID, message ID, and the new text or rich message.

Instructions

Use this method to edit text, rich and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were 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>",
      "text_or_rich_message": "<text_or_rich_message>"
    },
    "name": "editMessageText"
  }
}

Input Schema

NameRequiredDescriptionDefault
chat_idYesUnique identifier for the target chat or username of the target bot, supergroup or channel in the format `@username`
entitiesNoA list of special entities that appear in message text, which can be specified instead of parse_mode
message_idYesIdentifier of the message to edit
parse_modeNoMode for parsing entities in the message text. See formatting options for more details.
reply_markupNoAn object for an inline keyboard
link_preview_optionsNoLink preview generation options for the message
text_or_rich_messageYesNew text or rich content of the message, a string maps to the `text` parameter and an object maps to the `rich_message` parameter
business_connection_idNoUnique identifier of the business connection on behalf of which the message to be edited was sent

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the mutation risk is known; the description adds real value by disclosing the return contract (Message vs. True for inline messages) and the 48-hour editability window for business messages. It stops short of mentioning rate limits or what specifically fails on an expired message, so it is not fully exhaustive.

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?

Two front-loaded sentences: purpose first, then return semantics and the time-window caveat. No filler, though the caveat sentence is dense and could be split for easier scanning.

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?

Given eight parameters, nested objects, and no output schema, the description covers the essentials an agent cannot get from the schema: what is returned and the 48-hour business-message limitation. Gaps remain around failure modes and rate limiting, but the 100%-covered schema carries the field-level burden.

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 all eight parameters including the text_or_rich_message union and business_connection_id are already documented in structured form. The description adds only the high-level notion of text/rich/game message content and no syntax, exclusivity, or format detail beyond the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("edit text, rich and game messages") and clarifies the return value differs for inline vs. non-inline messages, which implicitly marks the boundary with editMessageTextInline. It never names a sibling or explicitly distinguishes itself from editEphemeralMessageText or the caption/media edit variants, so an agent must infer the division of labor.

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

Usage Guidelines3/5

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

Supplies one concrete eligibility rule (business messages not sent by the bot and without an inline keyboard can only be edited within 48 hours), which is genuinely useful when-deciding context. However, it offers no guidance on choosing between this tool and the many sibling edit methods (inline, ephemeral, caption, media, reply markup), leaving selection to inference.

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

Deploy Server

Other Tools