Skip to main content
Glama

discord_reply_to_forum

Post responses to Discord forum threads by providing a thread ID and message content for AI assistants to participate in discussions.

Instructions

Adds a reply to an existing forum post or thread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
threadIdYes
messageYes

Implementation Reference

  • The primary handler function that executes the discord_reply_to_forum tool: validates input, fetches the forum thread, checks permissions, sends the reply message, and returns success or error.
    export const replyToForumHandler: ToolHandler = async (args, { client }) => {
      const { threadId, message } = ReplyToForumSchema.parse(args);
    
      try {
        if (!client.isReady()) {
          return {
            content: [{ type: 'text', text: 'Discord client not logged in.' }],
            isError: true,
          };
        }
    
        const thread = await client.channels.fetch(threadId);
        if (!thread?.isThread()) {
          return {
            content: [
              { type: 'text', text: `Cannot find thread with ID: ${threadId}` },
            ],
            isError: true,
          };
        }
    
        if (!('send' in thread)) {
          return {
            content: [
              {
                type: 'text',
                text: 'This thread does not support sending messages',
              },
            ],
            isError: true,
          };
        }
    
        // Send the reply
        const sentMessage = await thread.send(message);
    
        return {
          content: [
            {
              type: 'text',
              text: `Successfully replied to forum post. Message ID: ${sentMessage.id}`,
            },
          ],
        };
      } catch (error) {
        return handleDiscordError(error);
      }
    };
  • MCP tool definition including name, description, and input schema (threadId and message required).
    {
      name: 'discord_reply_to_forum',
      description: 'Adds a reply to an existing forum post or thread',
      inputSchema: {
        type: 'object',
        properties: {
          threadId: { type: 'string' },
          message: { type: 'string' },
        },
        required: ['threadId', 'message'],
      },
    },
  • src/server.ts:128-131 (registration)
    Registration and dispatch in the MCP server's tool call handler switch statement, invoking the replyToForumHandler.
    case 'discord_reply_to_forum':
      this.logClientState('before discord_reply_to_forum handler');
      toolResponse = await replyToForumHandler(args, this.toolContext);
      return toolResponse;

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