Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
target_timestampYesTimestamp of the message to edit (from get_conversation or send_message response)
messageYesNew message text to replace the original
recipientNoPhone number for a DM message edit
group_idNoGroup ID for a group message edit

Implementation Reference

  • 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)
  • 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"],
        },
    ),
  • 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"]})
  • 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"]),
            )
  • Required parameter validation registration for edit_message (target_timestamp and message are required).
    "edit_message":         ["target_timestamp", "message"],
Behavior5/5

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

With no annotations, the description fully covers behavioral traits: how edits are sent, displayed inline with '(edited)' label, immutability of non-text parts, restriction to own messages, and time limit caveat. No contradictions.

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?

Every sentence adds value; well-structured with primary action first, then limitations, requirements, and usage examples. No redundant or unnecessary content.

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 moderate complexity (edit constraints, no output schema), description covers all necessary context: timestamp reference, mutual exclusivity, error conditions, client behavior caveats. Agent can use correctly.

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

Parameters5/5

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

Schema coverage is 100% (all 4 parameters described in schema). Description adds meaning: target_timestamp must match exact original timestamp, exclusivity of recipient vs group_id, and message as replacement 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 clearly states 'Edit the text of a previously sent message,' specifying the verb (edit) and resource (message). It distinguishes from siblings like send_message and delete_message by detailing what can and cannot be modified (text only, not attachments).

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?

Provides explicit when-to-use (correcting typos, updating info) and when-not-to-use (changing recipient). Also explains required exact timestamp and exclusive use of recipient or group_id, guiding correct invocation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/googlarz/signal-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server