Feature Description
Add support for fetching Discord messages by ID via a discord_fetch_message tool.
Motivation
Hermes currently cannot access Discord message history. When users paste Discord message links (e.g., https://discord.com/channels/1472019441586933937/1484330055529136158/1484330123011428442), Hermes can parse the link but cannot retrieve the actual message content. This limits conversation continuity and context awareness.
Proposed Solution
Implementation Plan
-
Expose Discord client to tools layer
- The Discord gateway adapter already has a Discord bot client
- Make it accessible to the tool system
-
Create discord_fetch_message tool
- File:
tools/discord_tool.py
- Parameters:
message_id (str, required): Discord message ID
channel_id (str, optional): Channel ID (if inferable from context)
- Returns: Message content, author, timestamp, attachments
-
Register the tool
- Add to
tools/registry.py
- Add to appropriate toolset in
toolsets.py
- Check that bot has "Read Message History" permission
-
Gateway integration
- Ensure the Discord client is available to the tool handler
- May need to pass the client through a singleton or dependency injection
Example Usage
User: https://discord.com/channels/1472019441586933937/1484330055529136158/1484330123011428442
Hermes: [Parses link] Fetching message 1484330123011428442 from channel 1484330055529136158...
Hermes: Found! User @diegohb said: "Here's the config we discussed earlier: [...]"
Technical Notes
- Discord API:
GET /channels/{channel.id}/messages/{message.id}
- Bot must be in the server and have access to the channel
- Rate limits: ~50 requests per second per bot (should be fine for Hermes use)
- Error handling: 404 (message deleted), 403 (no access), etc.
Alternatives Considered
- Search session history - Already works for past Hermes conversations, but not for messages Hermes wasn't present for
- User manual paste - Works but cumbersome, defeats the purpose of link references
- Full Discord history dump - Overkill, privacy concerns
Labels
enhancement, discord, tool, feature
Feature Description
Add support for fetching Discord messages by ID via a
discord_fetch_messagetool.Motivation
Hermes currently cannot access Discord message history. When users paste Discord message links (e.g.,
https://discord.com/channels/1472019441586933937/1484330055529136158/1484330123011428442), Hermes can parse the link but cannot retrieve the actual message content. This limits conversation continuity and context awareness.Proposed Solution
Implementation Plan
Expose Discord client to tools layer
Create
discord_fetch_messagetooltools/discord_tool.pymessage_id(str, required): Discord message IDchannel_id(str, optional): Channel ID (if inferable from context)Register the tool
tools/registry.pytoolsets.pyGateway integration
Example Usage
Technical Notes
GET /channels/{channel.id}/messages/{message.id}Alternatives Considered
Labels
enhancement, discord, tool, feature