discord plugin: fetch_messages fails for channel IDs exceeding float64 precision (JavaScript snowflake truncation)
Bug Description
The \fetch_messages\ tool in the \plugin:discord@claude-plugins-official\ plugin fails when the \chat_id\ parameter is a Discord snowflake ID that exceeds JavaScript's \Number.MAX_SAFE_INTEGER\ (2^53 - 1 ≈ 9×10^15).
Discord snowflake IDs are 64-bit integers and can be as large as ~9.2×10^18. When \fetch_messages\ internally converts the \chat_id\ string to a JavaScript \Number\, precision is lost and the resulting value is no longer a valid snowflake, causing the Discord API to reject it.
Error
\\\\
fetch_messages failed: Invalid Form Body
channel_id[NUMBER_TYPE_COERCE]: Value "undefined" is not snowflake.
\\
Reproduction
- Use a Discord channel whose ID exceeds 9007199254740991 (any sufficiently large snowflake)
- Call \
fetch_messages\with that \chat_id\ - The call fails with the error above
Expected Behavior
\fetch_messages\ should pass \chat_id\ as a string throughout, without numeric conversion. All Discord snowflake IDs should be treated as opaque strings.
Notes
- Inbound message delivery works correctly (snowflake arrives as a string via WebSocket push)
- Only \
fetch_messages\(which does an HTTP GET) is affected - The same bug may affect \
reply\, \react\, and \edit_message\for such channel IDs — worth checking
Environment
- Plugin: \
plugin:discord@claude-plugins-official\ - Platform: macOS (Darwin 25.3.0)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗