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
| Name | Required | Description | Default |
|---|---|---|---|
| guildId | Yes | The ID of the server (guild) | |
| emojiId | Yes | The ID of the emoji to delete | |
| reason | No | Reason for deleting the emoji |
Implementation Reference
- src/tools/emoji-tools.ts:84-109 (registration)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);
- src/tools/emoji-tools.ts:87-90 (schema)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'),