Skip to content

v1.20.0 — schema-in-error widget-type suggestions

Choose a tag to compare

@BenKalsky BenKalsky released this 07 Jul 16:02
0c9d9c3

Schema-in-error widget-type suggestions (P1.1, first slice)

When a tool is given a widget type that doesn't exist, the error now carries the nearest valid widget type names inline, so an agent that used a wrong name self-corrects in a single round trip (Novamira's single-roundtrip correction contract) instead of guessing or making a second discovery call.

  • elementor-mcp/add-widget with an unknown widget_typeinvalid_widget_type whose data includes suggestions (ranked exact → substring → smallest edit distance) and a schema_hint pointing at get-widget-schema.
  • elementor-mcp/get-widget-schema (the primary discovery tool) and Schema_Generator::generate() return the same suggestions in their widget_not_found error data.
  • New Elementor_MCP_Schema_Generator::suggest_types( $bad, $limit = 6 ).

Scope: this covers the wrong-widget-name mistake (the most common one). Attaching the full compact control schema to bad-settings rejections — which for Elementor 4 atomic widgets surface as save_rejected — needs an atomic prop-schema extractor and is the next slice. (The settings validator is deliberately advisory/non-fatal, so there's no settings-rejection path to enrich for legacy widgets.)

Full suite 683 green; +7 SchemaSuggestionsTest cases. Converged in 2 Codex rounds.