components_v2_build_container
components_v2_build_container
Section titled “components_v2_build_container”Category: components_v2
Build a Components V2 Container (type 17) JSON node ready to nest into components_v2_send.
When to use
Section titled “When to use”compose a card with accent color + multiple sections/separators.
When NOT to use
Section titled “When NOT to use”| Field | Type | Required | Description |
|---|---|---|---|
components | array | yes | Up to 10 child nodes (Section/TextDisplay/MediaGallery/File/Separator/ActionRow). NOT another Container. |
accent_color | integer | no | Hex RGB integer (0xFF0000 = red) |
spoiler | boolean | no | Wrap container in spoiler tag |
Returns
Section titled “Returns”\{component\} — the JSON node. Pass it inside the components array of components_v2_send.
Output schema
Section titled “Output schema”| Field | Type | Required | Description |
|---|---|---|---|
component | unknown | yes |
Annotations
Section titled “Annotations”| Property | Value |
|---|---|
| Read-only | yes |
| Destructive | no |
| Idempotent | yes |
| Open-world | no |
| Confirmation required | no |
Source
Section titled “Source”packages/mcp-core/src/tools/components-v2/build_container.ts