claude-code - 💡(How to fix) Fix [BUG] Slack MCP slack_read_file fails with invalid_union content validation error (content[1]) for binary files

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The official Slack MCP server (https://mcp.slack.com/mcp, connected via claude mcp add --transport http) successfully returns metadata and message content, but slack_read_file always fails when reading file contents. Claude Code's MCP client rejects the tool response with an invalid_union schema validation error on content[1].

This is distinct from #35995 (which was an OAuth-scope issue where slack_read_channel/slack_search_public failed). Here, channel reads and searches work fine — only file content retrieval fails, and it fails at the content-block schema layer rather than with a generic internal error.

Error Message

The client rejects the MCP tool result because content[1] matches none of the five allowed content block types (text, image, audio, resource_link, resource):

MCP error -32602: Invalid tools/call result: [
  {
    "code": "invalid_union",
    "path": ["content", 1],
    "errors": [
      [ { "code": "invalid_value", "values": ["text"], "path": ["type"] }, ... ],
      [ { "code": "invalid_value", "values": ["image"], "path": ["type"] }, ... ],
      [ { "code": "invalid_value", "values": ["audio"], "path": ["type"] }, ... ],
      [ { "code": "invalid_value", "values": ["resource_link"], "path": ["type"] }, ... ],
      [ { "code": "invalid_union", "path": ["resource"], ... } ]
    ],
    "message": "Invalid input"
  }
]

content[0] validates (text metadata); content[1] — the file payload block — does not. This points to the Slack MCP server returning a binary file payload in a content-block shape that Claude Code's content-union validator does not accept (a server-returns-X / client-expects-Y mismatch).

Root Cause

The client rejects the MCP tool result because content[1] matches none of the five allowed content block types (text, image, audio, resource_link, resource):

Code Example

MCP error -32602: Invalid tools/call result: [
  {
    "code": "invalid_union",
    "path": ["content", 1],
    "errors": [
      [ { "code": "invalid_value", "values": ["text"], "path": ["type"] }, ... ],
      [ { "code": "invalid_value", "values": ["image"], "path": ["type"] }, ... ],
      [ { "code": "invalid_value", "values": ["audio"], "path": ["type"] }, ... ],
      [ { "code": "invalid_value", "values": ["resource_link"], "path": ["type"] }, ... ],
      [ { "code": "invalid_union", "path": ["resource"], ... } ]
    ],
    "message": "Invalid input"
  }
]
RAW_BUFFERClick to expand / collapse

Summary

The official Slack MCP server (https://mcp.slack.com/mcp, connected via claude mcp add --transport http) successfully returns metadata and message content, but slack_read_file always fails when reading file contents. Claude Code's MCP client rejects the tool response with an invalid_union schema validation error on content[1].

This is distinct from #35995 (which was an OAuth-scope issue where slack_read_channel/slack_search_public failed). Here, channel reads and searches work fine — only file content retrieval fails, and it fails at the content-block schema layer rather than with a generic internal error.

What works

  • slack_read_user_profile
  • slack_search_channels
  • slack_read_channel ✅ (reads messages + file listings cleanly)

What fails

  • slack_read_file ❌ — for both .docx (21 KB) and .pdf (174 KB) files

Error

The client rejects the MCP tool result because content[1] matches none of the five allowed content block types (text, image, audio, resource_link, resource):

MCP error -32602: Invalid tools/call result: [
  {
    "code": "invalid_union",
    "path": ["content", 1],
    "errors": [
      [ { "code": "invalid_value", "values": ["text"], "path": ["type"] }, ... ],
      [ { "code": "invalid_value", "values": ["image"], "path": ["type"] }, ... ],
      [ { "code": "invalid_value", "values": ["audio"], "path": ["type"] }, ... ],
      [ { "code": "invalid_value", "values": ["resource_link"], "path": ["type"] }, ... ],
      [ { "code": "invalid_union", "path": ["resource"], ... } ]
    ],
    "message": "Invalid input"
  }
]

content[0] validates (text metadata); content[1] — the file payload block — does not. This points to the Slack MCP server returning a binary file payload in a content-block shape that Claude Code's content-union validator does not accept (a server-returns-X / client-expects-Y mismatch).

Reproduction

  1. claude mcp add --scope user --transport http slack https://mcp.slack.com/mcp
  2. Authenticate via /mcp (OAuth).
  3. Find a channel containing an uploaded .docx or .pdf file.
  4. Call slack_read_file with that file's ID.
  5. Observe the invalid_union error on content[1]; no file content is returned.

Note: claude mcp list reports the server as ✗ Failed to connect because the out-of-session health check does not carry the OAuth token; in-session tools work, so this is unrelated.

Expected

slack_read_file returns the file's content (text, or base64 for binary) per its tool description ("Returns text content directly or base64-encoded data for binary/image files ... 10MB size limit"), so it can be summarized/used downstream.

Actual

The entire tool result is rejected at validation; no content reaches the model.

Environment

  • Claude Code: 2.1.96
  • macOS: 26.5.1 (build 25F80)
  • Slack MCP: official server, HTTP transport, user scope, OAuth authenticated
  • Other Slack MCP tools in same session: working

Impact

File content cannot be read from Slack at all, which blocks any Slack -> read / Slack -> Drive document workflow, since the file bytes never make it through the file-read tool.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING