delete_sticker
Remove custom stickers from Discord servers by providing the server and sticker IDs. This tool helps manage server content by deleting unwanted or outdated stickers.
Instructions
Delete a custom sticker from a server
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guildId | Yes | The ID of the server (guild) | |
| stickerId | Yes | The ID of the sticker to delete | |
| reason | No | Reason for deleting the sticker |
Implementation Reference
- src/tools/emoji-tools.ts:238-254 (handler)The handler function for delete_sticker tool. Fetches the Discord guild and sticker using getDiscordClient, deletes the sticker with optional reason, wraps in withErrorHandling, and returns a JSON-formatted response or error.async ({ guildId, stickerId, reason }) => { const result = await withErrorHandling(async () => { const client = await getDiscordClient(); const guild = await client.guilds.fetch(guildId); const sticker = await guild.stickers.fetch(stickerId); const stickerName = sticker.name; await sticker.delete(reason); return { stickerId, stickerName, message: 'Sticker 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/tools/emoji-tools.ts:233-237 (schema)Zod schema defining the input parameters for the delete_sticker tool: required guildId and stickerId, optional reason.{ guildId: z.string().describe('The ID of the server (guild)'), stickerId: z.string().describe('The ID of the sticker to delete'), reason: z.string().optional().describe('Reason for deleting the sticker'), },
- src/tools/emoji-tools.ts:230-256 (registration)Direct registration of the delete_sticker tool in the registerEmojiTools function using server.tool() with schema and handler.server.tool( 'delete_sticker', 'Delete a custom sticker from a server', { guildId: z.string().describe('The ID of the server (guild)'), stickerId: z.string().describe('The ID of the sticker to delete'), reason: z.string().optional().describe('Reason for deleting the sticker'), }, async ({ guildId, stickerId, reason }) => { const result = await withErrorHandling(async () => { const client = await getDiscordClient(); const guild = await client.guilds.fetch(guildId); const sticker = await guild.stickers.fetch(stickerId); const stickerName = sticker.name; await sticker.delete(reason); return { stickerId, stickerName, message: 'Sticker 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)Top-level registration call to registerEmojiTools(server) in createMcpServer(), which includes the delete_sticker tool.registerEmojiTools(server);