Skip to main content
Glama
grammy-mcp
by louietyj

editMessageMediaInline

Destructive

Edit or replace media in an inline Telegram message using a file_id or URL, with optional inline keyboard updates. Supports photos, videos, documents, audio, and animations.

Instructions

Use this method to edit animation, audio, document, live photo, photo, or video inline messages, or to replace a text or a rich message with a media. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. 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": {
      "inline_message_id": "<inline_message_id>",
      "media": "<media>"
    },
    "name": "editMessageMediaInline"
  }
}

Input Schema

NameRequiredDescriptionDefault
mediaYesAn object for a new media content of the message
reply_markupNoAn object for a new inline keyboard
inline_message_idYesIdentifier of the inline message
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

A4.6/5.0
Behavior5/5

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

Annotations already declare destructive/open-world writes, and the description adds substantial behavior beyond them: the no-new-upload constraint for inline edits, the album type-matching rule, the dual return shape (edited Message or True), and the 48-hour window for business messages without an inline keyboard. These are exactly the operational details an agent needs before invoking a destructive edit.

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?

Purpose and scope are front-loaded, and every sentence carries operational content (album rules, upload restriction, return values, time limit). It is a dense single paragraph rather than a structured list, but there is little wasted wording.

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?

Despite four parameters with a nested object and no output schema, the description covers return values, media-type restrictions, upload limitations, and a temporal constraint for business messages. Nothing material for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3; the description earns an extra point by specifying that `media` can only reference an already-uploaded file via file_id or a URL in the inline case, which constrains how the media object must be built. Reply_markup and business_connection_id still get no additional meaning beyond their schema text.

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 opens with a specific verb plus an enumerated resource set (animation, audio, document, live photo, photo, video) and explicitly scopes itself to inline messages and to replacing text/rich messages with media. An agent can tell this apart from text- or caption-editing siblings without opening the schema.

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?

Gives real conditions for use: album editing is restricted to a matching media type (audio-for-audio, document-for-document, otherwise photo/live photo/video), and inline edits must reuse an existing file_id or URL. It does not explicitly route the agent to the non-inline editMessageMedia sibling or state a when-not case, so it stops short of full routing guidance.

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