Skip to main content
Glama

discord_ban_member

Ban users from Discord servers to enforce community rules and maintain moderation. Specify guild and user IDs, optional reason, and message deletion period.

Instructions

Ban a member from a guild.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guild_idYes
user_idYes
reasonNo
delete_message_daysNoDelete messages from last N days (0–7).

Implementation Reference

  • The handler logic for "discord_ban_member" which fetches the guild, validates the input, and calls discord.js to perform the ban.
    case "discord_ban_member": {
      const guild = await discord.guilds.fetch(validateId(args.guild_id, "guild_id"));
      const deleteDays = Math.min(Math.max(Number(args.delete_message_days ?? 0), 0), 7);
      await guild.members.ban(args.user_id as string, {
        reason: args.reason as string | undefined,
        deleteMessageSeconds: deleteDays * 86400,
      });
      return { content: [{ type: "text", text: `✅ User ${args.user_id} has been banned.` }] };
    }
  • The schema definition for the "discord_ban_member" tool.
      name: "discord_ban_member",
      description: "Ban a member from a guild.",
      inputSchema: {
        type: "object",
        properties: {
          guild_id: { type: "string" },
          user_id: { type: "string" },
          reason: { type: "string" },
          delete_message_days: { type: "number", description: "Delete messages from last N days (0–7)." },
        },
        required: ["guild_id", "user_id"],
      },
    },

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/PaSympa/discord-mcp'

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