Skip to main content
Glama

modify_emoji

Change custom emoji names and permissions in Discord servers to manage emoji usage and organization.

Instructions

Modify a custom emoji in a server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
emojiIdYesThe ID of the emoji to modify
nameNoNew name for the emoji
rolesNoRole IDs that can use this emoji
reasonNoReason for modifying the emoji

Implementation Reference

  • Handler function that implements the core logic for modifying a Discord emoji: fetches client, guild, and emoji; builds edit data from optional name, roles, reason; edits the emoji; returns updated info or formatted error response.
    async ({ guildId, emojiId, name, roles, 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 editData: { name?: string; roles?: string[]; reason?: string } = {}; if (name) editData.name = name; if (roles) editData.roles = roles; if (reason) editData.reason = reason; const updated = await emoji.edit(editData); return { id: updated.id, name: updated.name, roles: updated.roles.cache.map((r) => ({ id: r.id, name: r.name })), message: 'Emoji updated 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 modify_emoji tool.
    { guildId: z.string().describe('The ID of the server (guild)'), emojiId: z.string().describe('The ID of the emoji to modify'), name: z.string().optional().describe('New name for the emoji'), roles: z.array(z.string()).optional().describe('Role IDs that can use this emoji'), reason: z.string().optional().describe('Reason for modifying the emoji'), },
  • MCP server.tool registration for 'modify_emoji', including name, description, input schema, and handler reference.
    server.tool( 'modify_emoji', 'Modify a custom emoji in a server', { guildId: z.string().describe('The ID of the server (guild)'), emojiId: z.string().describe('The ID of the emoji to modify'), name: z.string().optional().describe('New name for the emoji'), roles: z.array(z.string()).optional().describe('Role IDs that can use this emoji'), reason: z.string().optional().describe('Reason for modifying the emoji'), }, async ({ guildId, emojiId, name, roles, 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 editData: { name?: string; roles?: string[]; reason?: string } = {}; if (name) editData.name = name; if (roles) editData.roles = roles; if (reason) editData.reason = reason; const updated = await emoji.edit(editData); return { id: updated.id, name: updated.name, roles: updated.roles.cache.map((r) => ({ id: r.id, name: r.name })), message: 'Emoji updated 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 call to registerEmojiTools on the MCP server, which registers modify_emoji along with other emoji tools.
    registerEmojiTools(server);
  • src/index.ts:16-16 (registration)
    Import of registerEmojiTools function that contains the modify_emoji tool registration.
    import { registerMessageTools } from './tools/message-tools.js';

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