Skip to main content
Glama
scarecr0w12

discord-mcp

create_emoji

Add custom emojis to Discord servers by uploading images and configuring usage permissions for enhanced community expression.

Instructions

Create a custom emoji in a server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
nameYesName for the emoji
imageUrlYesURL of the image to use (must be < 256KB)
rolesNoRole IDs that can use this emoji
reasonNoReason for creating the emoji

Implementation Reference

  • The handler function that executes the create_emoji tool: fetches the Discord guild and creates the emoji using guild.emojis.create(), handles errors with withErrorHandling, and returns JSON response.
    async ({ guildId, name, imageUrl, roles, reason }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const guild = await client.guilds.fetch(guildId);
    
        const emoji = await guild.emojis.create({
          attachment: imageUrl,
          name,
          roles,
          reason,
        });
    
        return {
          id: emoji.id,
          name: emoji.name,
          animated: emoji.animated,
          identifier: emoji.identifier,
          url: emoji.url,
          message: 'Emoji created 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 for create_emoji tool using Zod validation for parameters: guildId, name, imageUrl, optional roles and reason.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
      name: z.string().describe('Name for the emoji'),
      imageUrl: z.string().describe('URL of the image to use (must be < 256KB)'),
      roles: z.array(z.string()).optional().describe('Role IDs that can use this emoji'),
      reason: z.string().optional().describe('Reason for creating the emoji'),
    },
  • Registration of the create_emoji tool on the MCP server using server.tool(), including name, description, schema, and handler.
      'create_emoji',
      'Create a custom emoji in a server',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        name: z.string().describe('Name for the emoji'),
        imageUrl: z.string().describe('URL of the image to use (must be < 256KB)'),
        roles: z.array(z.string()).optional().describe('Role IDs that can use this emoji'),
        reason: z.string().optional().describe('Reason for creating the emoji'),
      },
      async ({ guildId, name, imageUrl, roles, reason }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
    
          const emoji = await guild.emojis.create({
            attachment: imageUrl,
            name,
            roles,
            reason,
          });
    
          return {
            id: emoji.id,
            name: emoji.name,
            animated: emoji.animated,
            identifier: emoji.identifier,
            url: emoji.url,
            message: 'Emoji created 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)
    Call to registerEmojiTools(server) which registers all emoji tools including create_emoji.
    registerEmojiTools(server);
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without disclosing behavioral traits. It doesn't mention required permissions, rate limits, whether the operation is idempotent, or what happens on failure. For a mutation tool with zero annotation coverage, this is insufficient.

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 directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, error conditions, or important behavioral context like permissions needed. Given the complexity of creating resources in a server environment, more information would be helpful.

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 the schema already documents all 5 parameters thoroughly. The description adds no additional parameter information beyond what's in the schema, meeting the baseline score when schema does the heavy lifting.

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 ('Create') and resource ('custom emoji in a server'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'modify_emoji' or 'delete_emoji', which would require explicit comparison to earn 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?

No guidance is provided on when to use this tool versus alternatives like 'modify_emoji' or 'list_emojis'. The description lacks context about prerequisites (e.g., permissions needed) or typical use cases, leaving the agent without usage direction.

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