automod_modify_rule
Update an AutoMod rule’s settings. Pass only fields you want to change.
When to use
Section titled “When to use”- Tweak keyword list, change actions, toggle enabled.
trigger_type is immutable - to change it, delete and recreate.
MCP call example
Section titled “MCP call example”{ "name": "automod_modify_rule", "arguments": { "guild_id": "123456789012345678", "rule_id": "123456789012345678", "name": "Example name" }}| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
guild_id | string | yes | pattern: ^\d{17,20}$ | Guild containing the rule |
rule_id | string | yes | pattern: ^\d{17,20}$ | Rule to modify |
name | string | no | min length: 1; max length: 100 | |
event_type | integer | no | AutoMod event type (1 MESSAGE_SEND, 2 MEMBER_UPDATE) | |
trigger_metadata | object | no | AutoMod trigger metadata (fields valid per trigger_type) | |
actions | array<object> | no | ||
enabled | boolean | no | ||
exempt_roles | array<string> | no | max items: 20 | |
exempt_channels | array<string> | no | max items: 50 | |
audit_reason | string | no | min length: 1; max length: 512 | Reason recorded in audit log (X-Audit-Log-Reason header) |
Complete input JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "guild_id": { "type": "string", "pattern": "^\\d{17,20}$", "description": "Guild containing the rule" }, "rule_id": { "type": "string", "pattern": "^\\d{17,20}$", "description": "Rule to modify" }, "name": { "type": "string", "minLength": 1, "maxLength": 100 }, "event_type": { "type": "integer", "description": "AutoMod event type (1 MESSAGE_SEND, 2 MEMBER_UPDATE)" }, "trigger_metadata": { "type": "object", "properties": { "keyword_filter": { "description": "KEYWORD/MEMBER_PROFILE: word list", "type": "array", "items": { "type": "string" } }, "regex_patterns": { "description": "KEYWORD/MEMBER_PROFILE: regex pattern list (max 10)", "type": "array", "items": { "type": "string" } }, "presets": { "description": "KEYWORD_PRESET: preset list (1 PROFANITY, 2 SEXUAL_CONTENT, 3 SLURS)", "type": "array", "items": { "anyOf": [ { "type": "number", "const": 1 }, { "type": "number", "const": 2 }, { "type": "number", "const": 3 } ] } }, "allow_list": { "description": "Substrings exempted from triggering", "type": "array", "items": { "type": "string" } }, "mention_total_limit": { "description": "MENTION_SPAM: max mentions per message", "type": "integer", "minimum": 0, "maximum": 50 }, "mention_raid_protection_enabled": { "description": "MENTION_SPAM: enable raid protection", "type": "boolean" } }, "description": "AutoMod trigger metadata (fields valid per trigger_type)" }, "actions": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "integer", "description": "Action type (1 BLOCK_MESSAGE, 2 SEND_ALERT_MESSAGE, 3 TIMEOUT, 4 BLOCK_MEMBER_INTERACTION)" }, "metadata": { "type": "object", "properties": { "channel_id": { "description": "Alert channel (action type 2)", "type": "string", "pattern": "^\\d{17,20}$" }, "duration_seconds": { "description": "Timeout duration (action type 3, max 28 days)", "type": "integer", "minimum": 0, "maximum": 2419200 }, "custom_message": { "description": "Custom message shown when blocking (action type 1)", "type": "string", "maxLength": 150 } } } }, "required": [ "type" ], "description": "AutoMod action descriptor" } }, "enabled": { "type": "boolean" }, "exempt_roles": { "maxItems": 20, "type": "array", "items": { "type": "string", "pattern": "^\\d{17,20}$", "description": "Discord role ID" } }, "exempt_channels": { "maxItems": 50, "type": "array", "items": { "type": "string", "pattern": "^\\d{17,20}$", "description": "Discord channel ID (snowflake)" } }, "audit_reason": { "description": "Reason recorded in audit log (X-Audit-Log-Reason header)", "type": "string", "minLength": 1, "maxLength": 512 } }, "required": [ "guild_id", "rule_id" ]}Returns
Section titled “Returns”{id, name, trigger_type, enabled}.
Example structured result
Section titled “Example structured result”{ "id": "123456789012345678", "name": "Example name", "trigger_type": 1, "enabled": true}Output schema
Section titled “Output schema”| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string | yes | pattern: ^\d{17,20}$ | Discord AutoMod rule ID |
name | string | yes | ||
trigger_type | integer | yes | ||
enabled | boolean | yes |
Complete output JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "id": { "type": "string", "pattern": "^\\d{17,20}$", "description": "Discord AutoMod rule ID" }, "name": { "type": "string" }, "trigger_type": { "type": "integer" }, "enabled": { "type": "boolean" } }, "required": [ "id", "name", "trigger_type", "enabled" ], "additionalProperties": false}Annotations
Section titled “Annotations”| Property | Value |
|---|---|
| Read-only | no |
| Destructive | no |
| Idempotent | yes |
| Open-world | yes |
| Confirmation required | no |
Access and common errors
Section titled “Access and common errors”- The
automodcategory must be enabled byMCP_CATEGORIESwhen an allowlist is set. - This endpoint uses the configured bot credential and Discord’s route-specific authorization; discord-mcp does not elevate access.
- An invalid credential returns a
401-class tool error. Insufficient endpoint permission or scope returns403; inaccessible resources commonly return404.
Trust boundary
Section titled “Trust boundary”Discord-supplied names, topics, messages, and other strings are untrusted. Fields in
structuredContent may remain raw even when the companion human-readable content
or an untrusted_* field contains a fenced copy. Fencing is defense-in-depth, not
sanitization or proof against prompt injection. Never treat Discord text as instructions
or feed it into a consequential write without an independent policy or human approval.
Source
Section titled “Source”packages/mcp-core/src/tools/automod/modify_rule.ts