Skip to main content
Glama

Edit a chat message

chat_edit

Edit your own sent chat message within 15 minutes by replacing its text; mentions are recalculated from the new content and the updated message is returned.

Instructions

Replaces the text of a message you sent yourself, within 15 minutes of sending; the message is then marked as edited and its mentions are recalculated from the new text. Other members' messages, deleted messages and older messages give 403 edit_not_allowed, an unknown id gives message_not_found, and a message deleted in the meantime gives 409 message_deleted. To post a new message use chat_send, to remove one use chat_delete. Returns the updated message.

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": {
      "id": "<id>",
      "body": "<body>"
    },
    "name": "chat_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesId of your own message to edit, from chat_messages or chat_send.
bodyYesNew message text that fully replaces the old one, trimmed, up to 4000 characters.
wgCodeNoShare code of the flat (code from wg_list). Leave it out when the account belongs to one flat.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / body / description
      Added value: +"New message text that fully replaces the old one, trimmed, up to 4000 characters."
    • addedInput schema / properties / id / description
      Added value: +"Id of your own message to edit, from chat_messages or chat_send."
  2. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only give the generic safety profile (readOnly=false, idempotent=false, destructive=false), and the description goes well beyond it: the 15-minute window, that mentions are recalculated from new text, and the exact failure modes with codes (403 edit_not_allowed, 404 message_not_found, 409 message_deleted). None of this contradicts the annotations, and it tells the agent what to do on each failure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One front-loaded sentence carries the operation and its limits, followed by error mapping and sibling routing, then the return value. Every clause adds information; there is no restatement of the title or the schema.

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?

For a three-parameter mutation with no output schema, the description covers preconditions, side effects (mention recalculation, edited flag), error conditions, alternatives, and the return value. An agent has everything needed to call it and to handle its outcomes.

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 would be 3, but the description adds validity constraints on `id` that the schema does not state: it must be your own message and must be recent enough to edit. That meaningfully changes how an agent sources and validates the id before calling.

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?

"Replaces the text of a message you sent yourself" names a specific verb (replace), resource (message text) and an explicit ownership scope. It is immediately distinguishable from chat_send (post new) and chat_delete (remove), so an agent can route correctly without reading another 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?

It states the preconditions for use (own message, within 15 minutes) and names the two alternatives with the condition that selects them: chat_send for new messages, chat_delete for removal. Nothing about when to choose this tool is left to inference.

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