components_v2_validate
Validate a Components V2 components array OFFLINE (no Discord API call). Enforces the 40-cap, placement and nesting rules, ActionRow cardinality, Button style contracts, unique custom_id values, accessory requirements, and MediaGallery range. File components are rejected because the current send/edit tools do not upload attachments.
When to use
Section titled “When to use”iterate on a layout before sending. Saves round-trips for agents constructing complex cards.
MCP call example
Section titled “MCP call example”{ "name": "components_v2_validate", "arguments": { "components": [ { "type": 10, "content": "Hello from discord-mcp" } ] }}| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
components | array<unknown> | yes | Components array (will be validated) |
Complete input JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "components": { "type": "array", "items": {}, "description": "Components array (will be validated)" } }, "required": [ "components" ]}Returns
Section titled “Returns”{valid, issues:[{path, code, message, fix_hint?}]}.
Example structured result
Section titled “Example structured result”{ "valid": true, "issues": [ { "path": "example", "code": "example", "message": "Hello from discord-mcp" } ]}Output schema
Section titled “Output schema”| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
valid | boolean | yes | ||
issues | array<object> | yes |
Complete output JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "valid": { "type": "boolean" }, "issues": { "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "fix_hint": { "type": "string" } }, "required": [ "path", "code", "message" ], "additionalProperties": false } } }, "required": [ "valid", "issues" ], "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/validate.ts