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
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| message | Yes |
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}" )]
- src/discord_mcp/integrated_server.py:844-861 (registration)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"] } ),
- src/discord_mcp/integrated_server.py:1021-1032 (registration)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)