send_message
Send messages to a specific Discord channel using a channel ID and content. Integrate Discord communication into MCP client workflows.
Instructions
Send a message to a specific channel
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | Discord channel ID | |
| content | Yes | Message content |
Input Schema (JSON Schema)
{
"properties": {
"channel_id": {
"description": "Discord channel ID",
"type": "string"
},
"content": {
"description": "Message content",
"type": "string"
}
},
"required": [
"channel_id",
"content"
],
"type": "object"
}
Implementation Reference
- src/discord_mcp/server.py:371-378 (handler)The handler logic for the 'send_message' tool within the call_tool function. It fetches the Discord channel by ID, sends the message with the given content, and returns a confirmation with the new message ID.if name == "send_message": 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. Message ID: {message.id}" )]
- src/discord_mcp/server.py:275-292 (registration)Registration of the 'send_message' tool in the list_tools() function, defining its name, description, and input schema requiring '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"] } ),