upsert_automation on the MCP endpoint declares location and automation as bare objects; the whole shape lives in the tool description. #2794 gives the tool library enum, array items and closed nested objects (closed_object), so both arguments can carry a real schema that Home Assistant's schema conversion shows the model and the validator refuses up front.
Proposed shape:
location: closed object over every key any kind uses (kind as an enum of the seven kinds, component_id, trigger, index, id, field, action_name), only kind required; the per kind key check stays in the handler.
automation: closed object with trigger_params (object) and actions (array of closed {action_id, params, children, conditions} items). children and conditions stay plain containers since the item schema cannot express recursion.
Depends on #2794 landing, then a PR stacked on #2789. Raised by Copilot on #2789 (#2789 (comment)); the description was expanded there and this is the structural follow up.
Scope note (after #2798): this types the tool call's own structure only, the location keys are Device Builder's wire model and action_id / condition_id are strings. params and trigger_params stay open objects, never enumerated against the catalog; esphome validates fields through validate_config.
upsert_automationon the MCP endpoint declareslocationandautomationas bare objects; the whole shape lives in the tool description. #2794 gives the tool libraryenum, arrayitemsand closed nested objects (closed_object), so both arguments can carry a real schema that Home Assistant's schema conversion shows the model and the validator refuses up front.Proposed shape:
location: closed object over every key any kind uses (kindas an enum of the seven kinds,component_id,trigger,index,id,field,action_name), onlykindrequired; the per kind key check stays in the handler.automation: closed object withtrigger_params(object) andactions(array of closed{action_id, params, children, conditions}items).childrenandconditionsstay plain containers since the item schema cannot express recursion.Depends on #2794 landing, then a PR stacked on #2789. Raised by Copilot on #2789 (#2789 (comment)); the description was expanded there and this is the structural follow up.
Scope note (after #2798): this types the tool call's own structure only, the location keys are Device Builder's wire model and
action_id/condition_idare strings.paramsandtrigger_paramsstay open objects, never enumerated against the catalog; esphome validates fields throughvalidate_config.