Gemini API / Antigravity Compatibility Fix
Fixes HTTP 400 errors when using the plugin with Gemini-based MCP clients (Antigravity, etc.) by sanitizing JSON Schema output.
What changed
- Centralized schema sanitizer — New
elementor_mcp_sanitize_schema()function recursively strips empty string values fromenumarrays and ensures emptypropertiesobjects serialize as{}(not[]). Applied to all 44 ability registrations viaelementor_mcp_register_ability()wrapper. - Control mapper hardening —
switcher,popover_toggle,select, andchoosecontrol types no longer emit empty enum values inget-widget-schemaoutput. - Container schema fix —
get-container-schemainput schema now usesstdClassfor empty properties (fixes'allOf' failed - got array, want objecterror). Runtime enum output also sanitized. - Import template fix — Added missing
itemsschema totemplate_jsonarray property (fixesitems: missing fielderror).
Background
Elementor controls often use empty strings as "default/none" option keys. Claude tolerates these, but the Gemini API strictly validates JSON Schema and rejects empty enum values. This affected 80+ properties across dozens of tools.
Closes #21