Skip to main content
Glama

delete_emoji

Remove custom emojis from Discord servers using server and emoji IDs to manage server content and organization.

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

  • The main handler function that performs the emoji deletion logic: fetches guild and emoji, deletes it with optional reason, wraps in error handling, and returns formatted response.
    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) }] };
  • Zod input schema for the delete_emoji tool defining required guildId and emojiId, optional reason.
    { 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'),
  • Registers the delete_emoji tool on the MCP server including name, description, schema, and handler.
    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:59-59 (registration)
    Calls registerEmojiTools(server) which registers the delete_emoji tool among others.
    registerEmojiTools(server);
  • src/index.ts:17-17 (registration)
    Imports the registerEmojiTools function used to register emoji tools including delete_emoji.
    import { registerEmojiTools } from './tools/emoji-tools.js';

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