Skip to main content
Glama

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
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
stickerIdYesThe ID of the sticker to delete
reasonNoReason for deleting the sticker

Implementation Reference

  • 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) }] };
  • 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'), },
  • 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);

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