Skip to main content
Glama
scarecr0w12

discord-mcp

delete_automod_rule

Remove an auto-moderation rule from a Discord server by specifying the guild ID and rule ID. This action deletes the rule permanently.

Instructions

Delete an auto-moderation rule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
ruleIdYesThe ID of the rule to delete
reasonNoReason for deletion

Implementation Reference

  • The handler function for delete_automod_rule tool. Fetches the Discord guild and auto-moderation rule, deletes the rule with optional reason, handles errors, and returns success message or error.
    async ({ guildId, ruleId, reason }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const guild = await client.guilds.fetch(guildId);
        const rule = await guild.autoModerationRules.fetch(ruleId);
        const ruleName = rule.name;
    
        await rule.delete(reason);
    
        return { ruleId, ruleName, message: 'Auto-moderation rule 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) }] };
    }
  • Input schema for delete_automod_rule tool using Zod validation: guildId (required string), ruleId (required string), reason (optional string).
    {
      guildId: z.string().describe('The ID of the server (guild)'),
      ruleId: z.string().describe('The ID of the rule to delete'),
      reason: z.string().optional().describe('Reason for deletion'),
    },
  • Registration of the delete_automod_rule tool on the MCP server within registerAuditTools function.
    server.tool(
      'delete_automod_rule',
      'Delete an auto-moderation rule',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        ruleId: z.string().describe('The ID of the rule to delete'),
        reason: z.string().optional().describe('Reason for deletion'),
      },
      async ({ guildId, ruleId, reason }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
          const rule = await guild.autoModerationRules.fetch(ruleId);
          const ruleName = rule.name;
    
          await rule.delete(reason);
    
          return { ruleId, ruleName, message: 'Auto-moderation rule 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) }] };
      }
    );
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. 'Delete' implies a destructive mutation, but the description doesn't specify whether this action is permanent, reversible, requires specific permissions, or has side effects (e.g., impact on existing moderation). This leaves significant gaps in understanding the tool's behavior.

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 with zero wasted words. It's front-loaded with the core action and resource, making it immediately understandable without unnecessary elaboration.

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 tool with no annotations and no output schema, the description is insufficient. It doesn't cover behavioral aspects (permanence, permissions), usage context, or what to expect after deletion. Given the complexity of a deletion operation, more context is needed to make this tool usable.

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 input schema has 100% description coverage, with clear documentation for guildId, ruleId, and reason. The description adds no additional parameter semantics beyond what's already in the schema (it doesn't explain format, constraints, or examples). This meets the baseline for high schema coverage.

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 ('an auto-moderation rule'), making the purpose unambiguous. However, it doesn't differentiate this tool from other deletion tools in the sibling list (like delete_channel, delete_role, etc.), which would require specifying it's specifically for auto-moderation rules.

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. There's no mention of prerequisites (like needing appropriate permissions), when deletion is appropriate, or what happens after deletion. The sibling list includes 'toggle_automod_rule' which might be an alternative for disabling rather than deleting, but this isn't addressed.

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