Skip to main content
Glama
scarecr0w12

discord-mcp

add_thread_member

Add a user to a Discord thread by providing guild, thread, and user IDs to manage thread participation.

Instructions

Add a member to a thread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
threadIdYesThe ID of the thread
userIdYesThe ID of the user to add

Implementation Reference

  • Handler function that fetches the thread and adds the specified user as a member using thread.members.add(userId). Wraps in error handling and returns JSON response.
    async ({ guildId, threadId, userId }) => {
      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.members.add(userId);
    
        return { threadId, userId, message: 'Member added to thread' };
      });
    
      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: guildId, threadId, userId.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
      threadId: z.string().describe('The ID of the thread'),
      userId: z.string().describe('The ID of the user to add'),
    },
  • Tool registration call using server.tool() with name 'add_thread_member', description, input schema, and handler function.
      'add_thread_member',
      'Add a member to a thread',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        threadId: z.string().describe('The ID of the thread'),
        userId: z.string().describe('The ID of the user to add'),
      },
      async ({ guildId, threadId, userId }) => {
        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.members.add(userId);
    
          return { threadId, userId, message: 'Member added to thread' };
        });
    
        if (!result.success) {
          return { content: [{ type: 'text', text: result.error }], isError: true };
        }
    
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies a write operation ('Add') but doesn't disclose permissions required, rate limits, error conditions (e.g., invalid IDs, permission denied), or what happens on success (e.g., confirmation message, member list update). For a mutation tool, this leaves critical 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, direct sentence with zero wasted words, making it highly efficient and front-loaded. It immediately conveys the core action without unnecessary elaboration, which is ideal for quick comprehension in a list of tools.

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 mutation tool with no annotations and no output schema, the description is insufficiently complete. It lacks details on behavioral traits (e.g., side effects, error handling), usage context, and expected outcomes. While concise, it doesn't compensate for the missing structured data, leaving the agent with significant gaps in understanding how to invoke and interpret this tool correctly.

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 100%, with all three parameters clearly documented in the schema (guildId, threadId, userId). The description adds no additional meaning beyond the schema's parameter descriptions, such as format examples or relationship context. Given the high coverage, a baseline score of 3 is appropriate as the schema handles the heavy lifting.

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 ('Add') and target ('a member to a thread'), making the purpose immediately understandable. It distinguishes itself from siblings like 'remove_thread_member' by specifying addition rather than removal, though it doesn't explicitly differentiate from other member-management tools like 'assign_role' or 'kick_member' beyond the thread context.

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. It doesn't mention prerequisites (e.g., user must be in the server, thread must be accessible), exclusions (e.g., cannot add bots or already-added members), or related tools like 'remove_thread_member' for undoing the action. The description assumes context without explicit instructions.

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