Skip to main content
Glama

discord_send

Send messages to Discord text channels by specifying channel ID and message content for automated communication.

Instructions

Sends a message to a specified Discord text channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
messageYes

Implementation Reference

  • The sendMessageHandler function that executes the 'discord_send' tool: validates input, checks client readiness, fetches the channel, and sends the message.
    export const sendMessageHandler: ToolHandler = async (args, { client }) => {
      const { channelId, message } = SendMessageSchema.parse(args);
    
      try {
        if (!client.isReady()) {
          return {
            content: [{ type: 'text', text: 'Discord client not logged in.' }],
            isError: true,
          };
        }
    
        const channel = await client.channels.fetch(channelId);
        if (!channel?.isTextBased()) {
          return {
            content: [
              { type: 'text', text: `Cannot find text channel ID: ${channelId}` },
            ],
            isError: true,
          };
        }
    
        // Ensure channel is text-based and can send messages
        if ('send' in channel) {
          await channel.send(message);
          return {
            content: [
              {
                type: 'text',
                text: `Message successfully sent to channel ID: ${channelId}`,
              },
            ],
          };
        }
        return {
          content: [
            {
              type: 'text',
              text: 'This channel type does not support sending messages',
            },
          ],
          isError: true,
        };
      } catch (error) {
        return handleDiscordError(error);
      }
    };
  • Input schema for 'discord_send' exposed in the tool list for MCP listTools request.
    {
      name: 'discord_send',
      description: 'Sends a message to a specified Discord text channel',
      inputSchema: {
        type: 'object',
        properties: {
          channelId: { type: 'string' },
          message: { type: 'string' },
        },
        required: ['channelId', 'message'],
      },
    },
  • src/server.ts:105-108 (registration)
    Registration and dispatching of 'discord_send' to sendMessageHandler in the MCP server's CallToolRequest handler.
    case 'discord_send':
      this.logClientState('before discord_send handler');
      toolResponse = await sendMessageHandler(args, this.toolContext);
      return toolResponse;
  • Zod schema for input validation used within the sendMessageHandler.
    export const SendMessageSchema = z.object({
      channelId: z.string(),
      message: z.string(),
    });
  • Re-export of sendMessageHandler for convenient import in server.ts.
    export { sendMessageHandler } from './send-message.js';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool sends a message, implying a write operation, but does not mention any behavioral traits such as rate limits, permissions required, message formatting constraints, or error handling. This leaves significant gaps for an agent to understand how to use it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly, with every part contributing essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a write operation with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It does not cover behavioral aspects like authentication needs, error cases, or return values, leaving the agent with insufficient context to invoke the tool correctly without additional assumptions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, so the description must compensate by explaining parameters. It mentions 'a specified Discord text channel' and 'message', which loosely map to 'channelId' and 'message', but provides no details on format (e.g., channel ID structure, message length limits) or semantics beyond basic naming. This adds minimal value over the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('sends a message') and target ('to a specified Discord text channel'), providing a specific verb+resource combination. However, it does not distinguish itself from sibling tools like 'discord_send_webhook_message' or 'discord_reply_to_forum', which also involve sending messages in different contexts, so it lacks sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as 'discord_send_webhook_message' for webhook-based messages or 'discord_reply_to_forum' for forum replies. It mentions a 'specified Discord text channel' but does not clarify prerequisites like authentication or channel access, leaving usage context implied at best.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/IQAIcom/mcp-discord'

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