Skip to main content
Glama
scarecr0w12

discord-mcp

delete_role

Remove a role from a Discord server by specifying the server and role IDs to manage server permissions and organization.

Instructions

Delete a role from a Discord server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
roleIdYesThe ID of the role to delete
reasonNoReason for deleting the role

Implementation Reference

  • The complete server.tool registration for 'delete_role', including schema validation and the handler function that fetches the guild and role using Discord.js and executes role.delete(reason). This is the exact implementation of the tool.
    server.tool(
      'delete_role',
      'Delete a role from a Discord server',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        roleId: z.string().describe('The ID of the role to delete'),
        reason: z.string().optional().describe('Reason for deleting the role'),
      },
      async ({ guildId, roleId, reason }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
          const role = await guild.roles.fetch(roleId);
          if (!role) throw new Error('Role not found');
    
          const roleName = role.name;
          await role.delete(reason);
          return { roleId, roleName, message: 'Role 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:57-57 (registration)
    Registration call for the role-tools module in the main MCP server setup, which includes the delete_role tool.
    registerRoleTools(server);
  • Zod schema defining input parameters for the delete_role tool: required guildId and roleId, optional reason.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
      roleId: z.string().describe('The ID of the role to delete'),
      reason: z.string().optional().describe('Reason for deleting the role'),
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Delete') which implies a destructive, irreversible operation, but doesn't mention permission requirements, rate limits, error conditions, or what happens to users who had that role. For a destructive tool with zero annotation coverage, this is a significant gap in transparency.

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 exactly what the tool does with zero wasted words. It's appropriately sized for a straightforward deletion operation and is perfectly front-loaded with the core action.

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 destructive mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address critical context like permission requirements, irreversible consequences, error handling, or what the response looks like. Given the complexity of a Discord API deletion operation, more behavioral context is needed.

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?

The schema description coverage is 100%, with all three parameters clearly documented in the schema itself. The description doesn't add any additional parameter context beyond what's in the schema (guildId, roleId, reason). Since the schema does the heavy lifting, 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 verb ('Delete') and resource ('a role from a Discord server'), making the purpose immediately understandable. It distinguishes itself from siblings like 'remove_role' (which removes a role from a member) and 'modify_role' (which edits role properties), though this differentiation isn't explicitly stated in the description itself.

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 appropriate permissions), warn about irreversible deletion, or differentiate from similar tools like 'remove_role' (which removes a role from a user) or 'modify_role' (which might deactivate instead of delete).

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