Skip to main content
Glama
scarecr0w12

discord-mcp

delete_emoji

Remove custom emojis from Discord servers by specifying the server and emoji IDs. This tool helps manage server content by deleting unwanted or outdated custom emojis.

Instructions

Delete a custom emoji from a server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
emojiIdYesThe ID of the emoji to delete
reasonNoReason for deleting the emoji

Implementation Reference

  • Registration and implementation of the 'delete_emoji' MCP tool, including input schema, handler logic that fetches the Discord guild and emoji then deletes it with optional reason, and error handling with response formatting.
    server.tool(
      'delete_emoji',
      'Delete a custom emoji from a server',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        emojiId: z.string().describe('The ID of the emoji to delete'),
        reason: z.string().optional().describe('Reason for deleting the emoji'),
      },
      async ({ guildId, emojiId, reason }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
          const emoji = await guild.emojis.fetch(emojiId);
          const emojiName = emoji.name;
    
          await emoji.delete(reason);
    
          return { emojiId, emojiName, message: 'Emoji deleted 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:60-60 (registration)
    High-level registration call for all emoji tools (including delete_emoji) on the MCP server instance.
    registerEmojiTools(server);
  • Zod input schema validation for the delete_emoji tool parameters.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
      emojiId: z.string().describe('The ID of the emoji to delete'),
      reason: z.string().optional().describe('Reason for deleting the emoji'),

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