Discord API Limitations
Discord REST API v10 rate limits, caching strategy, Components V2 payload ceilings (flags: 32768), and architectural boundaries between REST MCP tools and the live Discord Gateway bot.
Discord REST Rate Limits & Bounded Caching
Discord REST API v10 enforces both a global limit (50 requests per second per bot token) and per-route rate limit buckets. To prevent interactive MCP workflows from exhausting Discord quotas, Taicket wraps every Discord call with retry-aware handling (fetchWithRetry honoring 429 retry_after), bounded LRU caches, and in-flight request coalescing.
| Cached Resource | TTL | Max LRU Entries | Notes |
|---|---|---|---|
| User Guilds (/users/@me/guilds) | 2 minutes | 500 | Keyed by SHA-256(accessToken); stale-fallback on transient 5xx/429 |
| Bot Guilds (/users/@me/guilds) | 60 seconds | Singleton | Used for botInstalled status across server discovery |
| Guild Details (/guilds/{id}) | 90 seconds | 500 | Includes owner_id and approximate counts; 20s negative cache on 404 |
| Guild Channels (/guilds/{id}/channels) | 45 seconds | 500 | Invalidated immediately after structural auto-setup |
| Guild Roles (/guilds/{id}/roles) | 90 seconds | 500 | Sorted descending by position; excludes @everyone |
| Guild Members (/guilds/{id}/members/{uid}) | 90 seconds | 2,500 | 30s TTL for bot member hierarchy checks; 20s negative cache on 404 |
Discord Components V2 Limits (flags: 32768)
All panels deployed via deploy_discord_panel use discord-container-kit to emit Discord Components V2 Containers (type: 17) with flags: 32768 (or 32832 for ephemeral bot replies), accent colors, Type 14 Separators, and native Discord Unix timestamps (<t:TIMESTAMP:F>, <t:TIMESTAMP:R>, <t:TIMESTAMP:t>). Discord enforces strict payload ceilings on every Components V2 message:
| Constraint | Discord API v10 Limit | Taicket MCP Enforcement |
|---|---|---|
| Message Flag | flags: 32768 (IS_COMPONENTS_V2) | Set automatically by deploy_discord_panel; legacy top-level content and embeds are omitted when flags: 32768 is active |
| Single TextDisplay (type: 10) | 2,000 characters max | Validated by Zod schema and chunked/rejected with VALIDATION_ERROR if exceeded |
| Total Displayable Text Across Message | 4,000 characters max (COMPONENT_DISPLAYABLE_TEXT_SIZE_EXCEEDED) | Pre-validated before Discord REST POST/PATCH; bot callbacks clamp safely at 3,950 characters |
| Action Rows (type: 1) | Max 5 ActionRows per container / message context | Enforced during panel layout validation |
| Buttons per ActionRow (type: 2) | Max 5 buttons per row; 80-char max button label | Enforced per row; AI Ticket Panels 1-3 strictly keep a single ticket open button |
| Select Menu Options (type: 3 / 8) | Max 25 options per StringSelect; max 25 selectable values | Capped at 25 options with 100-char label and 100-char description limits |
| Media Gallery Images (type: 12) | Valid HTTPS public media or multipart attachment | Validated with DNS-rebinding-pinned SSRF check and magic-byte inspection; uploaded as native attachment:// where required |
{
"flags": 32768,
"components": [
{
"type": 17,
"accent_color": 3447003,
"components": [
{
"type": 10,
"content": "## Support Desk\nSelect the button below to open a private support ticket."
},
{
"type": 14,
"divider": true,
"spacing": 2
},
{
"type": 1,
"components": [
{
"type": 2,
"style": 1,
"label": "Open Support Ticket",
"custom_id": "ticket_open:default"
}
]
}
]
}
]
}REST API vs Discord Gateway Boundary
The standalone taicket-mcp process communicates strictly with Discord REST API v10 and never opens a Discord WebSocket Gateway connection. All real-time Gateway workloads remain isolated in the main Taicket bot process (bot/).
- Handled over REST by Taicket MCP:: Guild discovery, channel/role/emoji inspection, live member role lookups, native AutoMod rule sync, Components V2 panel deployment and editing, Enterprise per-guild bot nickname/avatar/bio updates, and rules channel message scraping.
- Owned exclusively by the Discord Gateway Bot (not MCP):: Real-time slash command and button interactions, live AI ticket chat streaming, Anti-Nuke audit-log event interception, voice channel audio streaming for Music, live EntitlementCreate/Update/Delete billing sync, and member join/leave event triggers.
- Intentionally excluded from MCP:: Live member-impacting moderation executions (banning/unbanning members, approving ban appeals, editing live XP/economy balances, releasing jailed users, mutating active giveaways, or deleting ticket transcripts) remain restricted to taicket.xyz or native Discord commands.