components_v2_validate
components_v2_validate
Section titled “components_v2_validate”Category: components_v2
Validate a Components V2 components array OFFLINE (no Discord API call). Catches 40-cap, nesting violations, accessory mismatches, MediaGallery range, Button missing custom_id/url.
When to use
Section titled “When to use”iterate on a layout before sending. Saves round-trips for agents constructing complex cards.
When NOT to use
Section titled “When NOT to use”| Field | Type | Required | Description |
|---|---|---|---|
components | array | yes | Components array (will be validated) |
Returns
Section titled “Returns”\{valid, issues:[\{path, code, message, fix_hint?\}]\}.
Output schema
Section titled “Output schema”| Field | Type | Required | Description |
|---|---|---|---|
valid | boolean | yes | |
issues | array | yes |
Annotations
Section titled “Annotations”| Property | Value |
|---|---|
| Read-only | yes |
| Destructive | no |
| Idempotent | yes |
| Open-world | no |
| Confirmation required | no |