Skip to main content
Glama
scarecr0w12

discord-mcp

kick_member

Remove a member from a Discord server by specifying the server and member IDs, with an optional reason for the action.

Instructions

Kick a member from the server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
memberIdYesThe ID of the member to kick
reasonNoReason for the kick

Implementation Reference

  • Handler function for kick_member tool. Fetches the Discord guild and member, verifies the member is kickable, executes member.kick(reason), and returns a success message or error.
    async ({ guildId, memberId, reason }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const guild = await client.guilds.fetch(guildId);
        const member = await guild.members.fetch(memberId);
    
        if (!member.kickable) {
          throw new Error('Cannot kick this member: insufficient permissions or role hierarchy');
        }
    
        const username = member.user.username;
        await member.kick(reason);
        return { memberId, username, message: 'Member kicked 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 the kick_member tool: required guildId and memberId, optional reason.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
      memberId: z.string().describe('The ID of the member to kick'),
      reason: z.string().optional().describe('Reason for the kick'),
    },
  • Registration of the kick_member tool via server.tool() call within registerMemberTools function, including name, description, schema, and handler.
    server.tool(
      'kick_member',
      'Kick a member from the server',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        memberId: z.string().describe('The ID of the member to kick'),
        reason: z.string().optional().describe('Reason for the kick'),
      },
      async ({ guildId, memberId, reason }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
          const member = await guild.members.fetch(memberId);
    
          if (!member.kickable) {
            throw new Error('Cannot kick this member: insufficient permissions or role hierarchy');
          }
    
          const username = member.user.username;
          await member.kick(reason);
          return { memberId, username, message: 'Member kicked 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:56-56 (registration)
    Top-level registration call to registerMemberTools(server) which includes the kick_member tool among other member management tools.
    registerMemberTools(server);
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 only states the basic action. It doesn't disclose critical behavioral traits such as required permissions, whether the action is reversible, notification to the member, audit logging, rate limits, or error conditions. For a destructive moderation tool, this is a significant gap.

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 zero waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 destructive moderation tool with no annotations and no output schema, the description is incomplete. It lacks information about permissions, consequences, error handling, and what happens after execution (e.g., does it return confirmation?). Given the complexity and potential impact, more context is needed.

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%, so the schema already documents all three parameters (guildId, memberId, reason). The description doesn't add any meaning beyond what's in the schema—it doesn't explain parameter relationships, format details, or practical usage examples. Baseline 3 is appropriate when schema does 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 ('kick') and target ('a member from the server'), providing specific verb+resource. However, it doesn't explicitly differentiate from sibling tools like 'ban_member' or 'remove_role', which might have overlapping functionality for member management.

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 'ban_member' or 'remove_role'. The description lacks context about prerequisites (e.g., permissions needed), consequences, or typical use cases for kicking versus other moderation actions.

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