components_v2_build_container
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.
MCP call example
Section titled “MCP call example”{ "name": "components_v2_build_container", "arguments": { "components": [ { "type": 10, "content": "Hello from discord-mcp" } ] }}| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
components | array<unknown> | yes | min items: 1; max items: 10 | Up to 10 child nodes (Section/TextDisplay/MediaGallery/File/Separator/ActionRow). NOT another Container. |
accent_color | integer | no | min: 0; max: 16777215 | Hex RGB integer (0xFF0000 = red) |
spoiler | boolean | no | Wrap container in spoiler tag |
Complete input JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "components": { "minItems": 1, "maxItems": 10, "type": "array", "items": {}, "description": "Up to 10 child nodes (Section/TextDisplay/MediaGallery/File/Separator/ActionRow). NOT another Container." }, "accent_color": { "description": "Hex RGB integer (0xFF0000 = red)", "type": "integer", "minimum": 0, "maximum": 16777215 }, "spoiler": { "description": "Wrap container in spoiler tag", "type": "boolean" } }, "required": [ "components" ]}Returns
Section titled “Returns”{component} - the JSON node. Pass it inside the components array of components_v2_send.
Example structured result
Section titled “Example structured result”{ "component": { "type": 17, "components": [ { "type": 10, "content": "Hello from discord-mcp" } ] }}Output schema
Section titled “Output schema”| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
component | unknown | yes |
Complete output JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "component": {} }, "required": [ "component" ], "additionalProperties": false}Annotations
Section titled “Annotations”| Property | Value |
|---|---|
| Read-only | yes |
| Destructive | no |
| Idempotent | yes |
| Open-world | no |
| Confirmation required | no |
Access and common errors
Section titled “Access and common errors”- The
components_v2category must be enabled byMCP_CATEGORIESwhen an allowlist is set. - This tool is local-only and does not call Discord. Schema or domain validation can still reject malformed input.
Source
Section titled “Source”packages/mcp-core/src/tools/components-v2/build_container.ts