Skip to content

Components V2 — rich product announcement

Discord’s Components V2 layout system replaces the cramped 2000-character message body with a tree of containers, sections, and media galleries. Components V2 is the right choice when an agent needs to post something that looks like a webpage — release notes, dashboards, formatted reports.

A product manager says: “Post the v2.0 launch announcement to #releases. Include the hero screenshot and the three feature thumbnails I uploaded.”

Plain messages_send would force the agent to cram everything into 2000 markdown characters. Components V2 instead lets the agent hand Discord a structured tree.

  1. Build the header section.

    A Section pairs text components with a single accessory (button, thumbnail, or media). For a launch banner, pair a heading + tagline with the hero image.

    {
    "name": "components_v2_build_section",
    "arguments": {
    "components": [
    { "type": "text_display", "content": "# discord-mcp v2.0" },
    { "type": "text_display", "content": "192 tools. Zero API keys. Production-ready." }
    ],
    "accessory": {
    "type": "thumbnail",
    "media": { "url": "https://cdn.example.com/launches/v2-hero.png" }
    }
    }
    }
  2. Build the screenshot gallery.

    Media galleries hold 1–10 images displayed as a grid. The builder produces a ready-to-send subtree.

    {
    "name": "components_v2_build_media_gallery",
    "arguments": {
    "items": [
    { "media": { "url": "https://cdn.example.com/launches/v2-feature-1.png" }, "description": "Tool browser" },
    { "media": { "url": "https://cdn.example.com/launches/v2-feature-2.png" }, "description": "Pipeline editor" },
    { "media": { "url": "https://cdn.example.com/launches/v2-feature-3.png" }, "description": "Audit log" }
    ]
    }
    }
  3. Wrap section + gallery in a container.

    Containers add a colored accent bar (accent_color) and group children. Pass the outputs of steps 1–2 as the container’s components array.

    {
    "name": "components_v2_build_container",
    "arguments": {
    "components": [ /* output of step 1 */, /* output of step 2 */ ],
    "accent_color": 5793266
    }
    }
  4. Validate before sending.

    Discord rejects malformed Components V2 trees with a generic 400. The components_v2_validate tool runs the same schema checks the server applies internally, so you catch errors before burning your rate-limit token.

    {
    "name": "components_v2_validate",
    "arguments": {
    "components": [ /* the container from step 3 */ ]
    }
    }

    On success the tool returns { valid: true, component_count: N }. On failure it returns precise paths to the broken nodes.

  5. Send to channel.

    {
    "name": "components_v2_send",
    "arguments": {
    "channel_id": "222233334444555566",
    "components": [ /* the validated container */ ]
    }
    }
  • Saves API quota. A failed send still consumes a rate-limit token. A failed components_v2_validate call is local-only.
  • Better error messages. Discord’s 400 says “invalid components”; the validator says “components[0].components[2].accessory.url must be https”.
  • Idempotent. Re-running validate has no side effects, so the agent can iterate freely.
NeedUse
Plain text reply, simple markdownmessages_send
Formatted report, multiple images, structured layoutcomponents_v2_send
Reusable layout with placeholderscomponents_v2_send_from_template