Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

delete_message

Remove a specific message from a Slack channel using the channel ID and message timestamp for precise deletion.

Instructions

Delete a message from a Slack channel.

Args: channel: Channel ID where the message exists ts: Timestamp of the message to delete

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYes
tsYes

Implementation Reference

  • MCP tool handler function for 'delete_message'. This is the primary entry point decorated with @mcp.tool(), which registers and executes the tool logic by calling the SlackClient helper.
    @mcp.tool() async def delete_message(channel: str, ts: str) -> str: """ Delete a message from a Slack channel. Args: channel: Channel ID where the message exists ts: Timestamp of the message to delete """ try: client = SlackClient() result = await client.delete_message(channel, ts) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
  • SlackClient helper method that implements the core logic by making the Slack API POST request to 'chat.delete' endpoint.
    async def delete_message(self, channel: str, ts: str) -> Dict[str, Any]: """Delete a message from a channel.""" data = {"channel": channel, "ts": ts} return await self._make_request("POST", "chat.delete", json_data=data)

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