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"
}
]
}
}
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"
]
}

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

{
"valid": true,
"issues": [
{
"path": "example",
"code": "example",
"message": "Hello from discord-mcp"
}
]
}
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
}
Property Value
Read-only yes
Destructive no
Idempotent yes
Open-world no
Confirmation required no
  • The components_v2 category must be enabled by MCP_CATEGORIES when an allowlist is set.
  • Access contract: scope=local; this tool uses no Discord credential (local or external operation) and is scoped to the local compiler/validator only.
  • No named Discord permission bit is asserted by this contract.
  • Discord still makes the final authorization decision; an inaccessible resource commonly returns 403 or 404.

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