Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

delete_message

Remove messages from Slack channels by specifying the channel ID and message timestamp to manage workspace content.

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler function for 'delete_message' that creates a SlackClient instance and calls its delete_message method to delete the specified message, returning JSON result or error.
    @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 makes the Slack API POST request to 'chat.delete' endpoint to delete the message.
    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)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Delete') but doesn't mention critical details like whether this is irreversible, requires specific user permissions, affects channel history, or has rate limits. This leaves significant gaps in understanding the tool's behavior beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by parameter explanations in a clear 'Args:' section. It avoids unnecessary words, though the parameter explanations could be slightly more detailed without sacrificing brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there's an output schema (which handles return values), no annotations, and low schema coverage, the description does an adequate job by stating the action and parameters. However, for a destructive tool like message deletion, it should ideally include more about permissions, irreversibility, or error cases to be fully complete.

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

Parameters3/5

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

Schema description coverage is 0%, but the description adds basic semantics by explaining that 'channel' is the 'Channel ID where the message exists' and 'ts' is the 'Timestamp of the message to delete'. This clarifies the purpose of each parameter beyond their types, though it doesn't provide format details or examples, keeping it at a baseline level.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Delete') and resource ('a message from a Slack channel'), making the purpose immediately understandable. However, it doesn't explicitly distinguish this tool from sibling tools like 'update_message' or 'search_messages', which would require more specific differentiation to achieve a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'update_message' or 'archive_channel', nor does it mention prerequisites such as permissions or context. It simply states what the tool does without indicating appropriate scenarios or exclusions.

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

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