Skip to main content
Glama
scarecr0w12

discord-mcp

create_forum_post

Create a new post in a Discord forum channel by specifying server, channel, title, and content. Apply tags and set auto-archive duration for organized discussions.

Instructions

Create a new post in a forum channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
channelIdYesThe ID of the forum channel
nameYesTitle of the post
contentYesContent of the initial message
appliedTagsNoTag IDs to apply
autoArchiveDurationNoAuto archive minutes
reasonNoReason for creating

Implementation Reference

  • The core handler function that executes the create_forum_post tool. It validates the channel is a forum channel, maps autoArchiveDuration, creates the thread with initial message and tags, and returns success/error response.
    async ({ guildId, channelId, name, content, appliedTags, autoArchiveDuration, reason }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const guild = await client.guilds.fetch(guildId);
        const channel = await guild.channels.fetch(channelId);
        
        if (!channel || channel.type !== ChannelType.GuildForum) {
          throw new Error('Channel is not a forum channel');
        }
    
        const forumChannel = channel as ForumChannel;
        const archiveDurationMap: Record<string, ThreadAutoArchiveDuration> = {
          '60': ThreadAutoArchiveDuration.OneHour,
          '1440': ThreadAutoArchiveDuration.OneDay,
          '4320': ThreadAutoArchiveDuration.ThreeDays,
          '10080': ThreadAutoArchiveDuration.OneWeek,
        };
    
        const thread = await forumChannel.threads.create({
          name,
          message: { content },
          appliedTags,
          autoArchiveDuration: autoArchiveDuration ? archiveDurationMap[autoArchiveDuration] : undefined,
          reason,
        });
    
        return {
          id: thread.id,
          name: thread.name,
          parentId: thread.parentId,
          appliedTags: thread.appliedTags,
          message: 'Forum post created successfully',
        };
      });
    
      if (!result.success) {
        return { content: [{ type: 'text', text: result.error }], isError: true };
      }
    
      return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
    }
  • Zod input schema defining parameters for creating a forum post: guildId, channelId, name (title), content, optional tags, autoArchiveDuration, and reason.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
      channelId: z.string().describe('The ID of the forum channel'),
      name: z.string().describe('Title of the post'),
      content: z.string().describe('Content of the initial message'),
      appliedTags: z.array(z.string()).optional().describe('Tag IDs to apply'),
      autoArchiveDuration: z.enum(['60', '1440', '4320', '10080']).optional().describe('Auto archive minutes'),
      reason: z.string().optional().describe('Reason for creating'),
    },
  • Registration of the 'create_forum_post' tool within registerThreadTools function using server.tool(name, description, schema, handler).
    server.tool(
      'create_forum_post',
      'Create a new post in a forum channel',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        channelId: z.string().describe('The ID of the forum channel'),
        name: z.string().describe('Title of the post'),
        content: z.string().describe('Content of the initial message'),
        appliedTags: z.array(z.string()).optional().describe('Tag IDs to apply'),
        autoArchiveDuration: z.enum(['60', '1440', '4320', '10080']).optional().describe('Auto archive minutes'),
        reason: z.string().optional().describe('Reason for creating'),
      },
      async ({ guildId, channelId, name, content, appliedTags, autoArchiveDuration, reason }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
          const channel = await guild.channels.fetch(channelId);
          
          if (!channel || channel.type !== ChannelType.GuildForum) {
            throw new Error('Channel is not a forum channel');
          }
    
          const forumChannel = channel as ForumChannel;
          const archiveDurationMap: Record<string, ThreadAutoArchiveDuration> = {
            '60': ThreadAutoArchiveDuration.OneHour,
            '1440': ThreadAutoArchiveDuration.OneDay,
            '4320': ThreadAutoArchiveDuration.ThreeDays,
            '10080': ThreadAutoArchiveDuration.OneWeek,
          };
    
          const thread = await forumChannel.threads.create({
            name,
            message: { content },
            appliedTags,
            autoArchiveDuration: autoArchiveDuration ? archiveDurationMap[autoArchiveDuration] : undefined,
            reason,
          });
    
          return {
            id: thread.id,
            name: thread.name,
            parentId: thread.parentId,
            appliedTags: thread.appliedTags,
            message: 'Forum post created successfully',
          };
        });
    
        if (!result.success) {
          return { content: [{ type: 'text', text: result.error }], isError: true };
        }
    
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
    );
  • src/index.ts:64-64 (registration)
    Top-level call to registerThreadTools(server) in createMcpServer(), which includes the create_forum_post tool registration.
    registerThreadTools(server);
  • src/index.ts:21-21 (registration)
    Import of registerThreadTools from thread-tools.ts in the main index.ts file.
    import { registerThreadTools } from './tools/thread-tools.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. While 'Create' implies a write operation, it doesn't specify permissions required, rate limits, whether the post is immediately visible, error conditions, or what happens on success (e.g., returns a post ID). For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 states the core functionality without unnecessary words. It's front-loaded with the essential action and resource, making it immediately scannable. Every word earns its place, with no redundant information or structural issues.

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?

For a 7-parameter mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address what the tool returns (post ID, error responses), permission requirements, or behavioral constraints. The agent lacks critical context needed to properly invoke this tool despite the good schema coverage.

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

Parameters3/5

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

The schema description coverage is 100%, with all 7 parameters well-documented in the schema itself. The description adds no additional parameter information beyond implying forum channel context. This meets the baseline of 3 for high schema coverage, but doesn't provide extra semantic context like explaining tag relationships or archive duration implications.

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 ('Create') and resource ('new post in a forum channel'), making the purpose immediately understandable. It distinguishes this from general message-sending tools like 'send_message' by specifying forum posts. However, it doesn't explicitly differentiate from 'create_thread' (which might be for regular text channels), leaving some ambiguity about sibling relationships.

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. It doesn't mention prerequisites (like needing forum channel permissions), when not to use it (e.g., for non-forum channels), or how it differs from similar tools like 'create_thread' or 'send_message' in the sibling list. The agent must infer usage context from the tool name 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/scarecr0w12/discord-mcp'

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