Skip to main content
Glama

messages_edit

Edit the text of a message you already sent, in place. Supported on Telegram, WhatsApp, LiveChat, Max.ru, LINE, WeChat and similar channels; NOT supported on Gmail, Instagram, or LinkedIn (their platforms forbid editing) — those return an explicit error. Note: channels impose their own limits (own messages only, edit time windows such as ~48h on Telegram / ~15min on WhatsApp).

Get the message_id from messages.read_history (each row's id).

To REPLACE the photo or file of a message that already has one, pass attachment_file_id (a DialogBrain file id, as messages.send takes in attachments); new_text then becomes the new caption and may be omitted to keep the caption. Supported on Telegram (user accounts and bots) only; a message without media is refused.

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": {
      "thread_id": "<thread_id>",
      "message_id": "<message_id>"
    },
    "name": "messages_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
mentionsNoPeople of a group chat the edited message @-tags, exactly as messages.send takes them: one item per member of THIS chat, by "name" (as shown in the chat), "phone" or "entity_id". An edit replaces the whole message, tags included: without this parameter a "@Name" in new_text of a group message tags the member it names, and an @-word that names nobody refuses the edit. WhatsApp keeps tags through an edit; on a channel whose edit cannot carry them, passing mentions refuses the edit (send a new message instead).
new_textNoReplacement text for the message (its caption when the message has media). Required unless attachment_file_id is given; with attachment_file_id, omit it to keep the caption.
thread_idYesThread ID containing the message (numeric DB id or channel_ref like 'telegram:-100123').
message_idYesID of the message to edit (from messages.read_history).
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.
attachment_file_idNoReplace the photo/file of a message that already has media with this DialogBrain file id (same ids as messages.send attachments). Telegram only; refused on other channels and on a message without media.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / attachment_file_id
      Added value: +{
      +  "description": "Replace the photo/file of a message that already has media with this DialogBrain file id (same ids as messages.send attachments). Telegram only; refused on other channels and on a message without media.",
      +  "type": "integer"
      +}
    • changedInput schema / properties / new_text / description
      Previous value: -"Replacement text for the message."New value: +"Replacement text for the message (its caption when the message has media). Required unless attachment_file_id is given; with attachment_file_id, omit it to keep the caption."
    • changedInput schema / required
      Previous value: -[
      -  "thread_id",
      -  "message_id",
      -  "new_text"
      -]New value: +[
      +  "thread_id",
      +  "message_id"
      +]
  2. Changed1 schema field changed
    • addedInput schema / properties / mentions
      Added value: +{
      +  "description": "People of a group chat the edited message @-tags, exactly as messages.send takes them: one item per member of THIS chat, by \"name\" (as shown in the chat), \"phone\" or \"entity_id\". An edit replaces the whole message, tags included: without this parameter a \"@Name\" in new_text of a group message tags the member it names, and an @-word that names nobody refuses the edit. WhatsApp keeps tags through an edit; on a channel whose edit cannot carry them, passing mentions refuses the edit (send a new message instead).",
      +  "items": {
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / in_workspace
      Added value: +{
      +  "description": "Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.",
      +  "type": "integer"
      +}
  4. Added
  5. Removed
  6. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations only say readOnly=false and destructive=false; the description adds substantial behavior: platform-specific edit time windows (~48h Telegram, ~15min WhatsApp), explicit errors on Gmail/Instagram/LinkedIn, ownership limits, and the fact that a media-less message is refused for attachment replacement. It stops short of describing the success response shape or whether repeated identical edits are treated as no-ops.

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-loads the core action and channel scope before the mechanics, and every sentence carries a constraint an agent needs. It is on the dense side and partially repeats schema text (mentions, attachment_file_id), costing a small amount of redundancy.

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?

No output schema exists, yet the description covers failure modes (channel refusals, media-less refusals, mention refusals, time windows) which is the important part for a mutation tool. Only the shape of a successful response is left unstated, a minor gap given annotations already mark this as non-destructive.

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 the baseline is 3, but the description adds real semantics beyond the schema: attachment_file_id is a DialogBrain file id matching messages.send, new_text becomes the caption and may be omitted in that case, and passing mentions on a channel that cannot carry tags refuses the edit rather than silently dropping them.

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 ("Edit the text of a message you already sent, in place") and immediately bounds scope by naming supported versus unsupported channels. An agent can distinguish this from messages_send/messages_delete without opening any 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?

Explicitly says which channels support editing and which refuse it, points to messages.read_history as the source of message_id, and redirects to sending a new message when mentions cannot survive an edit. When-to-use and when-not-to-use are both stated, not inferred.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.