Skip to content

feat(discord): add discord_server tool with 15 actions#11641

Open
suryanshsrivastava wants to merge 1 commit into
NousResearch:mainfrom
suryanshsrivastava:feat/discord-server-tool
Open

feat(discord): add discord_server tool with 15 actions#11641
suryanshsrivastava wants to merge 1 commit into
NousResearch:mainfrom
suryanshsrivastava:feat/discord-server-tool

Conversation

@suryanshsrivastava

@suryanshsrivastava suryanshsrivastava commented Apr 17, 2026

Copy link
Copy Markdown

Summary

Restores teknium's discord_server tool (originally from commit 2f323ec4, lost during rebase) and adds a new fetch_message action that accepts Discord message URLs for easy single-message retrieval.

What's included

New file: tools/discord_tool.py — 15 actions covering Discord server introspection and basic moderation:

Action Description
list_guilds List all guilds the bot is in
server_info Detailed guild info (member count, channels, roles, features)
list_channels All channels grouped by category
channel_info Detailed channel info (topic, NSFW, slowmode, thread metadata)
list_roles All roles with colors and permissions
member_info Member details (roles, join date, boosting status)
search_members Search members by query
fetch_messages Fetch message history from a channel (with pagination)
fetch_message NEW — Fetch a single message by ID or Discord URL
list_pins List pinned messages in a channel
pin_message Pin a message
unpin_message Unpin a message
create_thread Create a thread in a channel
add_role Add a role to a member
remove_role Remove a role from a member

Gated on DISCORD_BOT_TOKEN — the tool auto-registers when the env var is set, zero cost for non-Discord platforms.

Added to hermes-discord toolset in toolsets.py.

New: fetch_message

The original tool had fetch_messages for channel history but no way to look up a single message. fetch_message accepts:

  • Direct IDs: channel_id=123, message_id=456
  • Discord URL: message_url=https://discord.com/channels/GUILD/CHANNEL/MESSAGE

This is particularly useful for bot-to-bot communication where one bot posts a message and another needs to read it.

Related PRs & Issues

This PR builds on and complements several existing efforts:

Closes

Tests

48 unit tests in tests/tools/test_discord_tool.py covering all 15 actions, URL parsing, error handling, and toolset inclusion. Registry snapshot test updated.

All tests pass: pytest tests/tools/test_discord_tool.py tests/tools/test_registry.py -v → 79 passed.

Attribution

Original implementation by @teknium1 (commit 2f323ec4, Apr 3, 2026). Restored with the fetch_message addition.

Restores teknium's discord_server tool (originally from 2f323ec, lost
during rebase) and adds a new fetch_message action that accepts Discord
message URLs for easy single-message retrieval.

Actions: list_guilds, server_info, list_channels, channel_info,
list_roles, member_info, search_members, fetch_messages, fetch_message,
list_pins, pin_message, unpin_message, create_thread, add_role,
remove_role.

fetch_message accepts either channel_id+message_id or a full Discord URL
(https://discord.com/channels/GUILD/CHANNEL/MESSAGE).

Closes NousResearch#2105
Partially addresses NousResearch#1559
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.

Feature: Add discord_fetch_message tool

2 participants