Skip to content

Add a tool to download/read file attachments from messages #21

Description

@AlexanderMakarov

Problem

The server exposes message history, replies, search, and channel/user directories — but no way to retrieve the content of a file attached to a message. conversations_replies returns the file's ID and name (e.g. F0XXXXXXX (analysis.md), FileCount: 1), and that's a dead end: there is no tool to fetch the file body, and the MCP resources list only offers the channels/users directories.

Real-world impact: an agent asked to act on a document shared in a thread (a markdown analysis, a spec, a CSV) has to fall back to driving a real browser through the Slack web UI just to read an attachment it already knows the ID of. That is slow, fragile, and defeats the point of having the MCP server.

Proposal

Add a files_get_content tool (or expose files as MCP resources, e.g. slack://file/<FILE_ID>):

  • Input: file ID (from the message row), optionally channel/message ts for scoping.
  • Fetch via url_private_download with the existing auth token (works with both bot and user tokens as long as the token's identity has access to the conversation).
  • Return text content inline for text-like mimetypes (markdown, txt, csv, json, snippets/posts); for binaries either base64 with a size cap or just the metadata + a clear error.
  • Respect a size limit (e.g. 1 MB inline) with truncation flagged in the response.

Slack API surface needed: files.info (metadata + url_private_download) plus an authenticated GET — no extra scopes beyond files:read.

Notes

  • Text snippets and posts are the highest-value case; even a text-only first version would remove the browser workaround entirely.
  • The tool result should include file name, mimetype, and size so the agent can decide what to do with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions