Skip to main content
Glama

delete_sticker

Remove custom stickers from Discord servers by specifying 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 that executes the delete_sticker tool: fetches the Discord guild and sticker, deletes the sticker with optional reason, handles errors with withErrorHandling, and returns JSON-formatted response.
    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 for input parameters: 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'), },
  • Registers the 'delete_sticker' tool on the MCP server, including name, description, input schema, and handler function.
    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:60-60 (registration)
    Calls registerEmojiTools which includes the registration of delete_sticker among other emoji/sticker tools.
    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