components_v2_validate
Validate Discord Components V2 arrays offline to catch layout errors before sending. Enforces caps, nesting, ActionRow cardinality, button contracts, unique custom_ids, and media range without API calls.
Instructions
Purpose: 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: iterate on a layout before sending. Saves round-trips for agents constructing complex cards.
Returns: {valid, issues:[{path, code, message, fix_hint?}]}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| components | Yes | Components array (will be validated) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||