components_v2_build_section
Build a Components V2 Section (type 9) - 1-3 TextDisplay lines plus a REQUIRED Thumbnail or Button accessory (Discord rejects a Section without one).
When to use
Section titled “When to use”card-like content with header + supporting text + image.
MCP call example
Section titled “MCP call example”{ "name": "components_v2_build_section", "arguments": { "text": [ "Hello from discord-mcp" ], "accessory": { "type": 11, "media": { "url": "https://example.com/resource" } } }}| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
text | array<string> | yes | min items: 1; max items: 3 | 1-3 markdown text lines |
accessory | object | object | object | object | yes | Required Thumbnail (type 11) or Button (type 2) |
Complete input JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "text": { "minItems": 1, "maxItems": 3, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 4000 }, "description": "1-3 markdown text lines" }, "accessory": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "number", "const": 11 }, "media": { "type": "object", "properties": { "url": { "type": "string", "format": "uri" } }, "required": [ "url" ] }, "description": { "type": "string", "maxLength": 1024 }, "spoiler": { "type": "boolean" } }, "required": [ "type", "media" ] }, { "anyOf": [ { "type": "object", "properties": { "type": { "type": "number", "const": 2 }, "label": { "type": "string", "maxLength": 80 }, "emoji": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "animated": { "type": "boolean" } } }, "disabled": { "type": "boolean" }, "style": { "anyOf": [ { "type": "number", "const": 1 }, { "type": "number", "const": 2 }, { "type": "number", "const": 3 }, { "type": "number", "const": 4 } ] }, "custom_id": { "type": "string", "minLength": 1, "maxLength": 100 }, "url": { "not": {} }, "sku_id": { "not": {} } }, "required": [ "type", "style", "custom_id" ] }, { "type": "object", "properties": { "type": { "type": "number", "const": 2 }, "label": { "type": "string", "maxLength": 80 }, "emoji": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "animated": { "type": "boolean" } } }, "disabled": { "type": "boolean" }, "style": { "type": "number", "const": 5 }, "url": { "type": "string", "format": "uri" }, "custom_id": { "not": {} }, "sku_id": { "not": {} } }, "required": [ "type", "style", "url" ] }, { "type": "object", "properties": { "type": { "type": "number", "const": 2 }, "style": { "type": "number", "const": 6 }, "sku_id": { "type": "string", "pattern": "^\\d{17,20}$" }, "disabled": { "type": "boolean" }, "label": { "not": {} }, "emoji": { "not": {} }, "custom_id": { "not": {} }, "url": { "not": {} } }, "required": [ "type", "style", "sku_id" ] } ] } ], "description": "Required Thumbnail (type 11) or Button (type 2)" } }, "required": [ "text", "accessory" ]}Returns
Section titled “Returns”{component} - Section JSON node.
Example structured result
Section titled “Example structured result”{ "component": { "type": 9, "components": [ { "type": 10, "content": "Hello from discord-mcp" } ], "accessory": { "type": 11, "media": { "url": "https://example.com/image.png" } } }}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_section.ts