Skip to main content
Glama

send_message

Send text messages to Discord channels or threads using the Discord MCP Server. Specify the channel ID and message content to communicate with Discord communities.

Instructions

Send a message to a Discord text channel or thread.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYes
messageYes

Implementation Reference

  • The core handler function that implements the send_message tool. It fetches the Discord channel by ID, sends the provided message content, and returns a confirmation with the channel name and new message ID.
    async def handle_send_message(discord_client, arguments: Dict[str, Any]) -> List[TextContent]: """Send a message to a channel""" channel = await discord_client.fetch_channel(int(arguments["channel_id"])) message = await channel.send(arguments["content"]) return [TextContent( type="text", text=f"Message sent successfully to #{channel.name}. Message ID: {message.id}" )]
  • Registers the send_message tool with the MCP server via list_tools(), defining its name, description, and input schema (channel_id and content).
    Tool( name="send_message", description="Send a message to a specific channel", inputSchema={ "type": "object", "properties": { "channel_id": { "type": "string", "description": "Discord channel ID" }, "content": { "type": "string", "description": "Message content" } }, "required": ["channel_id", "content"] } ),
  • In the call_tool handler, send_message is listed in core_tool_names and dynamically dispatched to CoreToolHandlers.handle_send_message.
    core_tool_names = [ "get_server_info", "list_servers", "get_channels", "list_members", "get_user_info", "send_message", "read_messages", "add_reaction", "add_multiple_reactions", "remove_reaction", "moderate_message", "create_text_channel", "delete_channel", "add_role", "remove_role" ] if name in core_tool_names: handler_method = f"handle_{name}" if hasattr(CoreToolHandlers, handler_method): return await getattr(CoreToolHandlers, handler_method)(discord_client, arguments)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wowjinxy/mcp-discord'

If you have feedback or need assistance with the MCP directory API, please join our Discord server