Skip to main content

Droost: Canvas Tree Validate

droost_canvas_tree_validate Read-only

Module: Droost Canvas

Runs your would-be tree through Canvas's own validation constraints without writing — the mandatory step before droost_canvas_tree_set. "Required properties are missing" almost always means a defaulted or enum prop was omitted.

Example call
{
    "tool": "droost_canvas_tree_validate",
    "arguments": {
        "id": "1",
        "items": [
            {
                "component_id": "sdc.droost_tailwind.hero",
                "uuid": "aaaaaaaa-0000-4000-8000-000000000001",
                "inputs": {
                    "title": "Hello from the docs",
                    "subtitle": "A one-item example tree.",
                    "min_height": "compact"
                }
            }
        ]
    }
}
Example response — captured live on this site
{
    "success": true,
    "message": "VALID: 1 item(s) pass Canvas validation for canvas_page 1 (components). droost_canvas_tree_set with the same items will persist it.",
    "data": {
        "valid": true,
        "violations": [],
        "other_violations": [],
        "items": [
            {
                "uuid": "aaaaaaaa-0000-4000-8000-000000000001",
                "component_id": "sdc.droost_tailwind.hero",
                "parent_uuid": null,
                "slot": null,
                "inputs": "{\"title\":\"Hello from the docs\",\"subtitle\":\"A one-item example tree.\",\"min_height\":\"compact\"}",
                "label": null
            }
        ]
    }
}

Validates a proposed Canvas component tree against a real entity WITHOUT saving: Droost structural checks (item keys, uuid integrity, parent/slot pairing, inputs shape) plus Canvas's own constraints (components exist, versions valid, slots exist, inputs satisfy prop schemas) via in-memory entity validation. Items use the persisted contract: {component_id (Canvas Component id, e.g. "sdc.mercury.cta"), inputs (prop map), parent_uuid+slot for children, optional uuid/component_version/label}. Same input contract as droost_canvas_tree_set. Read-only (nothing persists).

Input schema (JSON Schema)
{
    "type": "object",
    "properties": {
        "entity_type": {
            "type": "string",
            "description": "Entity type id (default \"canvas_page\")."
        },
        "id": {
            "type": "string",
            "description": "The target entity id."
        },
        "field": {
            "type": "string",
            "description": "The component_tree field name; omit to auto-discover."
        },
        "items": {
            "type": "array",
            "description": "The proposed tree: ordered items {component_id, inputs?, parent_uuid?, slot?, uuid?, component_version?, label?}. Omitted uuids are generated; omitted versions are stamped with the component's active version.",
            "items": {
                "type": "object"
            }
        }
    },
    "required": [
        "id",
        "items"
    ]
}