Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_create_forum_post

Create organized discussions in Discord forum channels by posting new topics with relevant tags to categorize conversations effectively.

Instructions

Creates a new post in a Discord forum channel with optional tags

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forumChannelIdYes
titleYes
contentYes
tagsNo

Implementation Reference

  • The handler function for discord_create_forum_post that parses arguments using CreateForumPostSchema, validates the forum channel, handles optional tags by matching names to IDs, creates the forum thread/post using discord.js, and returns success message with thread ID or error.
    case "discord_create_forum_post": {
      const { forumChannelId, title, content, tags } = CreateForumPostSchema.parse(args);
      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(forumChannelId);
        if (!channel || channel.type !== ChannelType.GuildForum) {
          return {
            content: [{ type: "text", text: `Channel ID ${forumChannelId} is not a forum channel.` }],
            isError: true
          };
        }
    
        const forumChannel = channel as ForumChannel;
        
        // Get available tags in the forum
        const availableTags = forumChannel.availableTags;
        let selectedTagIds: string[] = [];
        
        // If tags are provided, find their IDs
        if (tags && tags.length > 0) {
          selectedTagIds = availableTags
            .filter(tag => tags.includes(tag.name))
            .map(tag => tag.id);
        }
    
        // Create the forum post
        const thread = await forumChannel.threads.create({
          name: title,
          message: {
            content: content
          },
          appliedTags: selectedTagIds.length > 0 ? selectedTagIds : undefined
        });
    
        return {
          content: [{ 
            type: "text", 
            text: `Successfully created forum post "${title}" with ID: ${thread.id}` 
          }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Failed to create forum post: ${error}` }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for discord_create_forum_post: forumChannelId (required string), title (required string), content (required string), tags (optional array of strings).
    const CreateForumPostSchema = z.object({
        forumChannelId: z.string(),
        title: z.string(),
        content: z.string(),
        tags: z.array(z.string()).optional()
    });
  • src/index.ts:238-254 (registration)
    Tool registration in the MCP server's tools list, specifying name, description, and JSON schema matching the Zod schema for input validation.
    {
      name: "discord_create_forum_post",
      description: "Creates a new post in a Discord forum channel with optional tags",
      inputSchema: {
        type: "object",
        properties: {
          forumChannelId: { type: "string" },
          title: { type: "string" },
          content: { type: "string" },
          tags: { 
            type: "array",
            items: { type: "string" }
          }
        },
        required: ["forumChannelId", "title", "content"]
      }
    },
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 it 'creates' a new post, implying a write operation, but lacks details on permissions required, rate limits, error conditions, or what happens on success (e.g., returns a post ID). This is a significant gap for a mutation tool with zero annotation coverage.

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 ('Creates a new post') and includes the key optional feature ('with optional tags'). There is no wasted verbiage, making it appropriately sized for the tool's complexity.

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 a mutation tool with 4 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain parameter meanings, behavioral traits like permissions or side effects, or return values, leaving critical gaps for agent invocation.

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?

Schema description coverage is 0%, so the schema provides no parameter details. The description mentions 'optional tags', which hints at the tags parameter, but doesn't explain forumChannelId, title, or content. It adds minimal value beyond the schema's property names, failing to fully compensate for the coverage gap.

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 verb ('creates') and resource ('new post in a Discord forum channel'), making the purpose specific and understandable. It distinguishes from siblings like discord_create_text_channel by specifying 'forum channel', but doesn't explicitly differentiate from discord_reply_to_forum or discord_delete_forum_post beyond the creation aspect.

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 (e.g., needing forumChannelId from discord_get_forum_channels), exclusions, or comparisons to siblings like discord_reply_to_forum or discord_send for other channel types, 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/jar285/mcp-discord'

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