Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_send

Send messages to Discord text channels using 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

  • Handler for the 'discord_send' tool. Parses arguments using SendMessageSchema, checks if client is ready, fetches the text channel, sends the message, and returns success or error response.
    case "discord_send": {
      // Use default channel ID if not provided
      let parsedArgs = SendMessageSchema.parse(args);
      if (parsedArgs.channelId === 'default') {
        parsedArgs.channelId = process.env.DEFAULT_CHANNEL_ID || '';
      }
      
      const { channelId, message } = parsedArgs;
      
      try {
        if (!client.isReady()) {
          return {
            content: [{ type: "text", text: "Discord client not logged in. Please use discord_login tool first." }],
            isError: true
          };
        }
        
        const channel = await client.channels.fetch(channelId);
        if (!channel || !(channel instanceof TextChannel)) {
          return {
            content: [{ type: "text", text: `Cannot find text channel with ID: ${channelId}` }],
            isError: true
          };
        }
        
        await channel.send(message);
        
        return {
          content: [{ 
            type: "text", 
            text: `Message sent to channel: ${channel.name}` 
          }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Send message failed: ${error}` }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the discord_send tool: channelId (string) and message (string). Used for validation in the handler.
    const SendMessageSchema = z.object({
        channelId: z.string(),
        message: z.string()
    });
  • src/index.ts:215-226 (registration)
    Tool registration in the MCP server's ListTools response. Defines name, description, and inputSchema matching the SendMessageSchema.
    {
      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"]
      }
    },
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 action ('sends a message') but omits critical details like required permissions (e.g., 'Send Messages' in Discord), rate limits, whether it's idempotent, or what happens on failure. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 front-loads the core action and resource without any wasted words. It's appropriately sized for a basic send operation, making it easy to parse and understand at a glance.

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 mutation with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions or error handling, and parameter semantics are lacking. For a Discord send operation, which involves API constraints and potential failures, this leaves the agent under-informed.

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?

Schema description coverage is 0%, so the description must compensate by explaining parameters, but it adds no meaning beyond the schema. It mentions 'a specified Discord text channel' and 'message' but doesn't clarify what 'channelId' represents (e.g., numeric ID vs. name) or 'message' constraints (e.g., length, formatting). With 2 undocumented parameters, this fails to provide adequate semantic context.

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 resource ('to a specified Discord text channel'), making the purpose immediately understandable. It doesn't distinguish from siblings like 'discord_send_webhook_message' or 'discord_reply_to_forum', which would require a 5, but it's specific enough to avoid vagueness or tautology.

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 like 'discord_send_webhook_message' or 'discord_reply_to_forum', nor does it mention prerequisites such as authentication or channel permissions. It implies usage for sending messages but lacks explicit context or exclusions, leaving the agent to infer based on tool names alone.

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

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