update_message
Modify an existing Slack message by updating its text or Block Kit formatting. Specify the channel ID, message timestamp, and new content to ensure accurate updates.
Instructions
Update an existing Slack message.
Args: channel: Channel ID where the message exists ts: Timestamp of the message to update text: New message text (fallback text for notifications) blocks: JSON string of Block Kit blocks for rich formatting
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blocks | No | ||
| channel | Yes | ||
| text | Yes | ||
| ts | Yes |
Implementation Reference
- slack_mcp/server.py:310-327 (handler)MCP tool handler for 'update_message'. Parses optional blocks JSON, creates SlackClient instance, calls client.update_message, and returns JSON response.@mcp.tool() async def update_message(channel: str, ts: str, text: str, blocks: Optional[str] = None) -> str: """ Update an existing Slack message. Args: channel: Channel ID where the message exists ts: Timestamp of the message to update text: New message text (fallback text for notifications) blocks: JSON string of Block Kit blocks for rich formatting """ try: client = SlackClient() blocks_data = json.loads(blocks) if blocks else None result = await client.update_message(channel, ts, text, blocks_data) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
- slack_mcp/server.py:116-125 (helper)SlackClient helper method that constructs the request payload and calls Slack's chat.update API endpoint.async def update_message( self, channel: str, ts: str, text: str, blocks: Optional[List[Dict[str, Any]]] = None ) -> Dict[str, Any]: """Update an existing message.""" data = {"channel": channel, "ts": ts, "text": text} if blocks: data["blocks"] = blocks return await self._make_request("POST", "chat.update", json_data=data)
- slack_mcp/server.py:310-310 (registration)Registration of the update_message tool via FastMCP @mcp.tool() decorator.@mcp.tool()
- slack_mcp/server.py:312-320 (schema)Input schema and documentation defined in the function docstring and type hints.""" Update an existing Slack message. Args: channel: Channel ID where the message exists ts: Timestamp of the message to update text: New message text (fallback text for notifications) blocks: JSON string of Block Kit blocks for rich formatting """