Skip to main content
Glama
scarecr0w12

discord-mcp

modify_emoji

Change custom emoji names and permissions in Discord servers to manage accessibility 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

  • Full tool registration for 'modify_emoji' including name, description, input schema with Zod validation, and the handler function that modifies the emoji using Discord.js API.
    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:60-60 (registration)
    Top-level registration call that invokes registerEmojiTools(server), which registers the modify_emoji tool among others.
    registerEmojiTools(server);
  • The core handler function for the modify_emoji tool. It fetches the guild and emoji, constructs edit data from parameters, calls emoji.edit(), handles errors with withErrorHandling, and returns formatted 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) }] };
    }
  • Input schema using Zod for validating parameters: guildId (required), emojiId (required), optional name, roles array, reason.
    {
      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'),
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Modify' implies a mutation operation, it doesn't specify required permissions, whether changes are reversible, rate limits, or what happens to existing emoji attributes not mentioned. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it immediately scannable. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address permission requirements, side effects, error conditions, or what the tool returns. While the schema covers parameters, the overall context for safe and effective use is lacking.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional parameter semantics beyond what's already in the schema (e.g., it doesn't explain format constraints for 'name' or how 'roles' array affects emoji visibility). With complete schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Modify') and resource ('custom emoji in a server'), making the purpose immediately understandable. It distinguishes from obvious siblings like 'create_emoji' and 'delete_emoji' by specifying modification rather than creation or deletion. However, it doesn't explicitly differentiate from other modification tools like 'modify_channel' or 'modify_role', which keeps it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing admin permissions), when modification is appropriate versus creating a new emoji, or how it differs from other emoji-related tools like 'list_emojis'. The agent must infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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