-
Notifications
You must be signed in to change notification settings - Fork 259
Description
Problem
When emails are forwarded to a Slack channel (via Slack's email integration), the message content is stored in the files[] array with filetype: "email" rather than in text or blocks. This results in completely empty text output from conversations_history and conversations_search tools.
Example Slack API response for an email message:
{
"text": "",
"blocks": [],
"attachments": [],
"files": [{
"filetype": "email",
"mode": "email",
"subject": "Meeting Tomorrow",
"plain_text": "Hi team, please join the meeting at 3pm.",
"from": [{"name": "John Doe", "address": "john@example.com"}],
"to": [{"name": "Email", "original": "Email <channel@workspace.slack.com>"}]
}]
}The MCP tool currently outputs an empty text column for these messages, even though the email subject and sender information is available in the files[] metadata.
Proposed Solution
Extract email metadata (subject, from) from files[] when:
msg.Textis emptyBlocksToText(msg.Blocks)returns empty (no Block Kit content)- The message contains files with
filetype == "email"
This would produce output like: [Email] From: John Doe (john@example.com) Subject: Meeting Tomorrow
Limitations
The plain_text field (email body) is not mapped in the slack-go/slack library's File struct, so only metadata (subject, sender) can be extracted via the standard API. Full email body content can still be retrieved via the existing attachment_get_data tool using the file ID.
Related
- Feature Request: Extract text content from message blocks in conversations_history #186 — Block Kit text extraction (addresses a different subset of empty-text messages)