Skip to content

feat: add read_channel tool for Discord channel history - #3666

Closed
aloysiusmartis wants to merge 1 commit into
NousResearch:mainfrom
aloysiusmartis:feat/read-channel-tool
Closed

feat: add read_channel tool for Discord channel history#3666
aloysiusmartis wants to merge 1 commit into
NousResearch:mainfrom
aloysiusmartis:feat/read-channel-tool

Conversation

@aloysiusmartis

Copy link
Copy Markdown

Summary

New tool: read_channel — reads message history from Discord channels and threads using the bot's existing token via the Discord REST API.

Features

  • Accepts channel IDs, Discord URLs, or #channel-name references
  • Returns formatted messages with timestamps, authors, attachments, reply context
  • Configurable limit (1-50 messages per call)
  • Gated on DISCORD_BOT_TOKEN availability via check_fn

Changes

New file

  • tools/read_channel_tool.py — full tool implementation with async Discord API calls

Registration (all 4 required layers)

  1. model_tools.py — added to _discover_tools() import list
  2. toolsets.py — added to _HERMES_CORE_TOOLS + messaging toolset definition
  3. hermes_cli/tools_config.py — added messaging to CONFIGURABLE_TOOLSETS

Bug fix: messaging toolset missing from CONFIGURABLE_TOOLSETS

The messaging toolset (containing send_message) was not in CONFIGURABLE_TOOLSETS. This means _get_platform_tools() in tools_config.py silently excluded it when building the platform tool list for Discord/Telegram/CLI sessions.

send_message was only working via legacy/composite toolset resolution paths — not through the proper configurable toolset pipeline. Adding messaging to CONFIGURABLE_TOOLSETS fixes this for both send_message and read_channel.

Use case

Enables the agent to read conversation context from other Discord channels/threads — useful for cross-channel awareness, summarizing discussions, and agent-to-agent collaboration.

New tool: read_channel — reads message history from Discord channels and
threads using the bot's existing token via REST API.

Features:
- Accepts channel IDs, Discord URLs, or #channel-name references
- Returns formatted messages with timestamps, authors, attachments, reply context
- Limit 1-50 messages per call
- Gated on DISCORD_BOT_TOKEN availability (check_fn)

Registration (all 4 layers):
1. tools/read_channel_tool.py — tool implementation + registry.register()
2. model_tools.py — added to _discover_tools() import list
3. toolsets.py — added to _HERMES_CORE_TOOLS + messaging toolset
4. hermes_cli/tools_config.py — added messaging to CONFIGURABLE_TOOLSETS

The CONFIGURABLE_TOOLSETS addition is critical: without it, the messaging
toolset (including send_message) is silently excluded by the platform tool
filter in _get_platform_tools(). This means send_message was only working
by accident via legacy resolution paths.

Co-authored-by: Al's bot
@aloysiusmartis aloysiusmartis closed this by deleting the head repository Apr 25, 2026
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/tools Tool registry, model_tools, toolsets platform/discord Discord bot adapter labels Apr 25, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Superseded by #10736 (channel history tool) and #11641 (discord_server tool with 15 actions including fetch_message). Core read_channel functionality covered there.

@alt-glitch

Copy link
Copy Markdown
Collaborator

superseded comment posted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have platform/discord Discord bot adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants