Skip to main content
Glama
grammy-mcp
by louietyj

editMessageCaption

Destructive

Updates the caption of an existing Telegram message by chat ID and message ID, with optional formatting and inline keyboard support.

Instructions

Use this method to edit captions of 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>"
    },
    "name": "editMessageCaption"
  }
}

Input Schema

NameRequiredDescriptionDefault
captionNoNew caption of the message, 0-1024 characters after entities parsing
chat_idYesUnique identifier for the target chat or username of the target bot, supergroup or channel in the format `@username`
message_idYesIdentifier of the message to edit
parse_modeNoMode for parsing entities in the message caption. See formatting options for more details.
reply_markupNoAn object for an inline keyboard
caption_entitiesNoA list of special entities that appear in the caption, which can be specified instead of parse_mode
business_connection_idNoUnique identifier of the business connection on behalf of which the message to be edited was sent
show_caption_above_mediaNoPass True if the caption must be shown above the message media. Supported only for animation, photo and video messages.

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 disclose mutability and open-world scope, and the description adds genuine value beyond them: the return shape (edited Message for non-inline, True for inline) and the 48-hour editability window for business messages not sent by the bot without an inline keyboard. It stops short of describing permission/error conditions for invalid captions or unknown message ids.

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?

Three sentences, front-loaded with the action, then the return behavior, then the editability constraint; nothing is wasted. The return-value sentence is slightly verbose but still earns its place given there is no output schema.

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?

For an 8-parameter mutation tool with no output schema, explaining the return value and the business-message time limit covers the most consequential gaps. It omits that caption is optional (allowing reply_markup-only edits) and says nothing about failure modes, which would round it out.

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 every parameter already carries its own documentation including the character limit and parse_mode enum. The description adds no meaning beyond the schema, which sets the baseline at 3.

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 captions of messages'. It is clearly distinguishable from text/media editing siblings by naming captions, though it does not explicitly contrast itself with editMessageCaptionInline, which handles the inline-message case.

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?

Usage is implied by the purpose statement, and the 48-hour constraint on business messages gives a real applicability condition. But there is no explicit comparison against editMessageText, editMessageCaptionInline, or editMessageReplyMarkup, so the agent must infer when this tool is the right choice.

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