Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

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
NameRequiredDescriptionDefault
blocksNo
channelYes
textYes
tsYes

Implementation Reference

  • 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)
  • 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)
  • Registration of the update_message tool via FastMCP @mcp.tool() decorator.
    @mcp.tool()
  • 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 """

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/piekstra/slack-mcp-server'

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