Skip to content

components_v2_validate

Components v2 Read only

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.

iterate on a layout before sending. Saves round-trips for agents constructing complex cards.

{
"name": "components_v2_validate",
"arguments": {
"components": [
{
"type": 10,
"content": "Hello from discord-mcp"
}
]
}
}
FieldTypeRequiredConstraintsDescription
componentsarray<unknown>yesComponents 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"
]
}

{valid, issues:[{path, code, message, fix_hint?}]}.

{
"valid": true,
"issues": [
{
"path": "example",
"code": "example",
"message": "Hello from discord-mcp"
}
]
}
FieldTypeRequiredConstraintsDescription
validbooleanyes
issuesarray<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
}
PropertyValue
Read-onlyyes
Destructiveno
Idempotentyes
Open-worldno
Confirmation requiredno
  • The components_v2 category must be enabled by MCP_CATEGORIES when an allowlist is set.
  • This tool is local-only and does not call Discord. Schema or domain validation can still reject malformed input.

packages/mcp-core/src/tools/components-v2/validate.ts