Components V2 — rich product announcement
Components V2: rich product announcement
Section titled “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.
Use case
Section titled “Use case”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.
Tool flow
Section titled “Tool flow”-
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" }}}}{"type": 9,"components": [{ "type": 10, "content": "# discord-mcp v2.0" },{ "type": 10, "content": "192 tools. Zero API keys. Production-ready." }],"accessory": {"type": 11,"media": { "url": "https://cdn.example.com/launches/v2-hero.png" }}} -
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" }]}}{"type": 12,"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" }]} -
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’scomponentsarray.{"name": "components_v2_build_container","arguments": {"components": [ /* output of step 1 */, /* output of step 2 */ ],"accent_color": 5793266}} -
Validate before sending.
Discord rejects malformed Components V2 trees with a generic 400. The
components_v2_validatetool 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. -
Send to channel.
{"name": "components_v2_send","arguments": {"channel_id": "222233334444555566","components": [ /* the validated container */ ]}}{"message_id": "888899990000111122","channel_id": "222233334444555566","jump_url": "https://discord.com/channels/111122223333444455/222233334444555566/888899990000111122","component_count": 6}
Why validate before sending
Section titled “Why validate before sending”- Saves API quota. A failed send still consumes a rate-limit token. A failed
components_v2_validatecall 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.
Components V2 vs messages_send
Section titled “Components V2 vs messages_send”| Need | Use |
|---|---|
| Plain text reply, simple markdown | messages_send |
| Formatted report, multiple images, structured layout | components_v2_send |
| Reusable layout with placeholders | components_v2_send_from_template |
See also
Section titled “See also”components_v2_send— schema for the final send call.components_v2_validate— full validator output shape.components_v2_build_container,components_v2_build_section,components_v2_build_media_gallery— the three builders used here.- Recipe: webhook execute — Components V2 via webhooks for high-volume announcements.
- Architecture: Components V2 — how the builders compose into Discord’s component tree.