list_stickers
Retrieve all custom stickers from a Discord server by providing the guild ID. This tool helps manage server assets by displaying available stickers for review or organization.
Instructions
List all custom stickers in a server
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guildId | Yes | The ID of the server (guild) |
Implementation Reference
- src/tools/emoji-tools.ts:159-183 (handler)The handler function for the 'list_stickers' tool. Fetches stickers from a Discord guild using the client, maps sticker data to a structured object, wraps in error handling, and returns JSON-formatted response or error.async ({ guildId }) => { const result = await withErrorHandling(async () => { const client = await getDiscordClient(); const guild = await client.guilds.fetch(guildId); const stickers = await guild.stickers.fetch(); return stickers.map((sticker) => ({ id: sticker.id, name: sticker.name, description: sticker.description, tags: sticker.tags, format: sticker.format, available: sticker.available, guildId: sticker.guildId, user: sticker.user ? { id: sticker.user.id, username: sticker.user.username } : null, url: sticker.url, })); }); 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:156-158 (schema)Input schema for 'list_stickers' tool using Zod: requires 'guildId' as string describing the Discord server/guild ID.{ guildId: z.string().describe('The ID of the server (guild)'), },
- src/tools/emoji-tools.ts:153-184 (registration)MCP server tool registration for 'list_stickers', specifying name, description, input schema, and handler reference.server.tool( 'list_stickers', 'List all custom stickers in a server', { guildId: z.string().describe('The ID of the server (guild)'), }, async ({ guildId }) => { const result = await withErrorHandling(async () => { const client = await getDiscordClient(); const guild = await client.guilds.fetch(guildId); const stickers = await guild.stickers.fetch(); return stickers.map((sticker) => ({ id: sticker.id, name: sticker.name, description: sticker.description, tags: sticker.tags, format: sticker.format, available: sticker.available, guildId: sticker.guildId, user: sticker.user ? { id: sticker.user.id, username: sticker.user.username } : null, url: sticker.url, })); }); if (!result.success) { return { content: [{ type: 'text', text: result.error }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] }; } );