Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

upload_file

Upload files to Slack channels by specifying channel IDs, file content, and filename. Add titles and comments to share information directly in Slack workspaces.

Instructions

Upload a file to one or more Slack channels.

Args: channels: Comma-separated list of channel IDs content: File content as text filename: Name for the file title: Title of the file initial_comment: Initial comment for the file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelsYes
contentYes
filenameYes
titleNo
initial_commentNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for upload_file: decorated with @mcp.tool(), parses input, calls SlackClient.upload_file, returns JSON result or error.
    @mcp.tool()
    async def upload_file(
        channels: str, content: str, filename: str, title: Optional[str] = None, initial_comment: Optional[str] = None
    ) -> str:
        """
        Upload a file to one or more Slack channels.
    
        Args:
            channels: Comma-separated list of channel IDs
            content: File content as text
            filename: Name for the file
            title: Title of the file
            initial_comment: Initial comment for the file
        """
        try:
            client = SlackClient()
            channels_list = channels.split(",")
            result = await client.upload_file(channels_list, content, filename, title, initial_comment)
            return json.dumps(result, indent=2)
        except Exception as e:
            return json.dumps({"error": str(e)}, indent=2)
  • SlackClient helper method that makes the actual Slack API call to files.upload with prepared parameters.
    async def upload_file(
        self,
        channels: List[str],
        content: str,
        filename: str,
        title: Optional[str] = None,
        initial_comment: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Upload a file to one or more channels."""
        data = {"channels": ",".join(channels), "content": content, "filename": filename}
    
        if title:
            data["title"] = title
    
        if initial_comment:
            data["initial_comment"] = initial_comment
    
        return await self._make_request("POST", "files.upload", json_data=data)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions uploading to channels but doesn't disclose critical behavioral traits: required permissions (e.g., upload files in Slack), rate limits, file size restrictions, supported file types, whether it overwrites existing files, or what happens on failure. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 appropriately sized and front-loaded with the core purpose in the first sentence, followed by a structured parameter list. Every sentence earns its place by clarifying inputs, though it could be more concise by integrating parameter details into the main text or using bullet points for better readability.

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 complexity (a mutation tool with 5 parameters, no annotations, but with an output schema), the description is moderately complete. It covers the basic purpose and parameters, but lacks behavioral context (e.g., permissions, limits) and usage guidance. The presence of an output schema means return values don't need explanation, but other gaps remain for effective tool selection and invocation.

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%, so the description must compensate. It lists all 5 parameters with brief explanations (e.g., 'channels: Comma-separated list of channel IDs'), which adds meaning beyond the bare schema. However, it doesn't provide format details (e.g., channel ID format, filename extensions), constraints (e.g., max length for content), or examples, leaving some ambiguity for practical use.

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 action ('Upload a file') and target ('to one or more Slack channels'), which is specific and unambiguous. However, it doesn't differentiate from sibling tools like 'send_message' or 'send_formatted_message' that might also involve file sharing or content delivery, leaving some room for confusion about when to choose this specific file upload method.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'send_message' (which might support attachments) and 'send_formatted_message', the description doesn't clarify if this is the primary method for file uploads, if it's for bulk uploads to multiple channels, or if it has specific use cases like sharing text files versus other content types.

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