Skip to content

Webhooks — bypass bot rate limits for high volume

Webhooks: bypass bot rate limits for high volume

Section titled “Webhooks: bypass bot rate limits for high volume”

A bot user has one global rate-limit bucket per route, shared across every guild it’s installed in. For a high-volume publisher (CI alerts, cross-poster, metrics relay) this becomes the bottleneck long before Discord’s per-channel limits do. The fix is webhooks — each webhook URL has its own bucket.

Ops engineer says: “Set up a webhook in #ci-alerts and use it for all GitHub Actions notifications. Don’t burn our bot’s rate limit on this.”

Two tool calls split across time: provision the webhook once (capture the token), then call webhooks_execute from there on out.

  1. Provision the webhook (one time).

    webhooks_create returns the full webhook record including the token. Capture the id and token and store them outside the agent’s working memory — typically in a secrets manager or a sealed config file.

    {
    "name": "webhooks_create",
    "arguments": {
    "channel_id": "222233334444555566",
    "name": "github-actions-notifier",
    "audit_reason": "ops: bypass bot bucket for CI alerts"
    }
    }
  2. Post via webhooks_execute.

    The token replaces bot authentication. No Authorization header is sent on this call — the token in the request body is the credential. This is the auth: false semantics in the tool’s transport layer.

    {
    "name": "webhooks_execute",
    "arguments": {
    "webhook_id": "444455556666777788",
    "token": "REDACTED-treat-as-credential",
    "content": "Build #4127 failed on `main` — https://github.com/cappylab/discord-mcp/actions/runs/4127",
    "username": "GitHub Actions",
    "wait": true
    }
    }
ConcernBot userWebhook
Rate-limit bucketshared across all guildsper webhook URL
AuthAuthorization: Bot <token> headertoken in URL/body, no header
Display identitybot’s name + avatarper-message username and avatar_url override
Can react / reply / edit other messagesyesno
Cost to provisionone bot install per workspaceone webhooks_create per channel

When sending Components V2 through a webhook, you must set both:

  • flags: 32768 — the IS_COMPONENTS_V2 bit (1 << 15).
  • with_components: true — query parameter telling Discord to include the component tree in the returned message (only matters when wait: true).
  • Webhooks can only post. They can’t react, reply with interactions, or edit messages other than their own. For interactive flows, stick with the bot.
  • One channel per webhook. A webhook is bound to its creation channel. Cross-posting requires multiple webhooks.
  • Token leakage = full impersonation. Treat tokens like API keys. Anyone with the token can post as the webhook with no further auth.