Skip to main content
Glama
scarecr0w12

discord-mcp

join_thread

Add a bot to a Discord thread to enable participation and management within that specific conversation channel.

Instructions

Make the bot join a thread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
threadIdYesThe ID of the thread

Implementation Reference

  • Handler function that fetches the Discord guild and thread, validates the thread, calls thread.join() to make the bot join, and returns a formatted response or error.
      async ({ guildId, threadId }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
          const thread = await guild.channels.fetch(threadId);
    
          if (!thread || !thread.isThread()) {
            throw new Error('Thread not found');
          }
    
          await thread.join();
    
          return { threadId, threadName: thread.name, message: 'Joined thread 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 required string parameters: guildId and threadId.
      guildId: z.string().describe('The ID of the server (guild)'),
      threadId: z.string().describe('The ID of the thread'),
    },
  • Registration of the 'join_thread' tool on the MCP server using server.tool(), including name, description, schema, and inline handler.
      'join_thread',
      'Make the bot join a thread',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        threadId: z.string().describe('The ID of the thread'),
      },
      async ({ guildId, threadId }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
          const thread = await guild.channels.fetch(threadId);
    
          if (!thread || !thread.isThread()) {
            throw new Error('Thread not found');
          }
    
          await thread.join();
    
          return { threadId, threadName: thread.name, message: 'Joined thread 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)
    Call to registerThreadTools on the main MCP server instance in the application entry point, which includes the join_thread tool registration.
    registerThreadTools(server);
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 ('join a thread') but doesn't explain what happens upon joining (e.g., access to messages, notification settings, or error conditions like if the bot is already a member). For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 with no wasted words. It's front-loaded with the core action ('Make the bot join a thread'), making it easy to parse quickly. Every word contributes directly to the purpose.

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 no annotations and no output schema), the description is incomplete. It doesn't cover behavioral aspects like permissions needed, what 'join' entails operationally, or potential outcomes. For a tool that modifies state, more context is needed to use it effectively.

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 input schema has 100% description coverage, with clear documentation for 'guildId' and 'threadId'. The description doesn't add any meaning beyond the schema, such as explaining where to find these IDs or their format. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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

Purpose3/5

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

The description 'Make the bot join a thread' clearly states the action (join) and target (a thread), but it's vague about scope and doesn't differentiate from sibling tools like 'add_thread_member' or 'leave_thread'. It specifies 'the bot' as the actor, which adds some context, but lacks details about what 'join' entails in this platform.

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?

No guidance is provided on when to use this tool versus alternatives like 'add_thread_member' (which might add other users) or 'leave_thread'. The description doesn't mention prerequisites, such as bot permissions or thread visibility, or exclusions for when it shouldn't be used.

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