edit_message
Edit the text of a previously sent Signal message to correct typos or update information. Recipients see the updated text inline with an '(edited)' label.
Instructions
Edit the text of a previously sent message. Sends the edit via signal-cli to all original recipients; they see the updated text inline with an '(edited)' label. Only the message text can be modified — attachments, quoted replies, and reactions are immutable. The edit must reference the exact timestamp of the original message as returned by send_message or get_conversation. Edits can only be made to messages you sent; editing someone else's message returns an error. There is no enforced time limit, but Signal clients may ignore edits on very old messages. Provide recipient for a DM edit or group_id for a group edit; exactly one is required. Use when correcting a typo or updating information in a message you already sent. Do NOT use to change who a message was sent to — send a new message instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_timestamp | Yes | Timestamp of the message to edit (from get_conversation or send_message response) | |
| message | Yes | New message text to replace the original | |
| recipient | No | Phone number for a DM message edit | |
| group_id | No | Group ID for a group message edit |
Implementation Reference
- src/signal_mcp/client.py:1023-1039 (handler)The primary handler: edit_message method on SignalClient that calls signal-cli JSON-RPC 'editMessage' and updates the local store.
async def edit_message( self, target_timestamp: int, message: str, recipient: str | None = None, group_id: str | None = None, ) -> None: """Edit a previously sent message and update the local store.""" if not recipient and not group_id: raise SignalError("Either recipient or group_id must be provided") params: dict = {"targetTimestamp": target_timestamp, "message": message} if group_id: params["groupId"] = group_id else: params["recipient"] = [recipient] await self._rpc("editMessage", params) await asyncio.to_thread(_store.update_message_body, target_timestamp, message, self.account) - src/signal_mcp/server.py:125-148 (schema)MCP tool definition (schema) for 'edit_message' — defines name, description, and inputSchema with target_timestamp, message, recipient, and group_id parameters.
Tool( name="edit_message", description=( "Edit the text of a previously sent message. " "Sends the edit via signal-cli to all original recipients; they see the updated text inline with an '(edited)' label. " "Only the message text can be modified — attachments, quoted replies, and reactions are immutable. " "The edit must reference the exact timestamp of the original message as returned by send_message or get_conversation. " "Edits can only be made to messages you sent; editing someone else's message returns an error. " "There is no enforced time limit, but Signal clients may ignore edits on very old messages. " "Provide recipient for a DM edit or group_id for a group edit; exactly one is required. " "Use when correcting a typo or updating information in a message you already sent. " "Do NOT use to change who a message was sent to — send a new message instead." ), inputSchema={ "type": "object", "properties": { "target_timestamp": {"type": "integer", "description": "Timestamp of the message to edit (from get_conversation or send_message response)"}, "message": {"type": "string", "description": "New message text to replace the original"}, "recipient": {"type": "string", "description": "Phone number for a DM message edit"}, "group_id": {"type": "string", "description": "Group ID for a group message edit"}, }, "required": ["target_timestamp", "message"], }, ), - src/signal_mcp/server.py:1190-1197 (registration)MCP call_tool dispatch for 'edit_message' — validates required params and calls client.edit_message().
elif name == "edit_message": await client.edit_message( target_timestamp=arguments["target_timestamp"], message=arguments["message"], recipient=arguments.get("recipient"), group_id=arguments.get("group_id"), ) return _ok({"status": "message edited", "target_timestamp": arguments["target_timestamp"]}) - src/signal_mcp/store.py:229-258 (helper)Helper function update_message_body that updates the stored message body and syncs the FTS index after an edit.
def update_message_body(target_timestamp_ms: int, new_body: str, sender: str | None = None) -> None: """Update a stored message's body after an edit. Also syncs FTS index. sender: if provided, restricts the update to messages from this sender, preventing accidental collision when two messages have the same millisecond timestamp. """ init_db() with _db() as conn: if sender: row = conn.execute( "SELECT rowid, id, sender, body FROM messages WHERE timestamp = ? AND sender = ?", (target_timestamp_ms, sender), ).fetchone() else: row = conn.execute( "SELECT rowid, id, sender, body FROM messages WHERE timestamp = ? LIMIT 1", (target_timestamp_ms,), ).fetchone() if not row: return conn.execute("UPDATE messages SET body = ? WHERE id = ?", (new_body, row["id"])) # Sync FTS: remove stale entry, insert updated conn.execute( "INSERT INTO messages_fts(messages_fts, rowid, id, body, sender) VALUES ('delete', ?, ?, ?, ?)", (row["rowid"], row["id"], row["body"], row["sender"]), ) conn.execute( "INSERT INTO messages_fts(rowid, id, body, sender) VALUES (?, ?, ?, ?)", (row["rowid"], row["id"], new_body, row["sender"]), ) - src/signal_mcp/server.py:1146-1146 (registration)Required parameter validation registration for edit_message (target_timestamp and message are required).
"edit_message": ["target_timestamp", "message"],