Ensure your bot has the MANAGE_GUILD permission in the target server
POST to https://discord.com/api/v10/guilds/{guild.id}/auto-moderation/rules with a JSON body specifying name, event_type (1 for message send), trigger_type, trigger_metadata, and actions array
For keyword-based rules set trigger_type to 1 and populate trigger_metadata.keyword_filter (max 100 keywords, each up to 60 characters) and optionally allow_list for exemptions
Define at least one action in the actions array; action types include block message (1), send alert message (2), and timeout (3)
Optionally set exempt_roles and exempt_channels arrays so moderators and bot channels are not subject to the rule
Known gotchas
Each guild has a limit on the number of rules per trigger type; exceeding the limit returns a 400 error — check existing rules before creating new ones
Keyword rules with trigger_type KEYWORD_PRESET accept up to 1000 allowed terms in the allow_list but only the preset categories (profanity, sexual content, slurs) can be targeted, not arbitrary keywords
The actions array must contain at least one entry; an empty array causes a validation error and the rule is not created
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp