Skip to main content
Glama

Call any Home Assistant action

services_call_service
Destructive

Call any Home Assistant service by domain and name over HTTP when no dedicated tool exists. Pass data for fields and targets; returns changed states.

Instructions

Call any Home Assistant action by domain and service name over HTTP.

Posts to /api/services/<domain>/<service> with data as the JSON body; data holds both fields and targets (entity_id/area_id/ device_id). Effect depends entirely on the domain/service passed. domain/service must match [A-Za-z0-9_]+ (ADR-0006 D3) or the call is refused before any request is built. Refuses hassio.addon_stop/ app_stop/addon_stdin/app_stdin against nexus's own add-on (self_protection.is_own_addon); addon_restart/app_restart stay allowed. homeassistant.restart/stop, hassio.host_reboot/ host_shutdown/restore_full/restore_partial, update.install and group.remove additionally require confirm=True (ADR-0006 D2) — a human-in-the-loop checkpoint, not a security boundary; ignored for every other service.

Use when: no dedicated tool exists for the action needed. Not for: an action returning response data (e.g. weather.get_forecasts) — use ws_call_service, which refuses the same eight guarded services outright (ADR-0006 D5) instead of accepting confirm. Returns: the list of states changed during the call. Errors: {"error": "invalid_service_name"} for a malformed domain/service; {"error": "self_addon_hassio_service_blocked", "message": ...} for the blocked hassio.* cases; {"error": "confirmation_required", "message": ..., "action": ...} for a guarded service called without confirm=True.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoService data: fields plus targets (entity_id/area_id/device_id). Omit for a call that needs no data.
domainYesService domain to call, e.g. 'light' or 'climate'.
confirmNoRequired True to actually run one of eight guarded services: homeassistant.restart/stop, hassio.host_reboot/host_shutdown/restore_full/restore_partial, update.install, group.remove. False (default) performs no action for those instead and returns a confirmation prompt; ignored for every other service.
serviceYesService name within the domain, e.g. 'turn_on' or 'set_temperature'.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.25.1
    • addedInput schema / properties / confirm
      Added value: +{
      +  "default": false,
      +  "description": "Required True to actually run one of eight guarded services: homeassistant.restart/stop, hassio.host_reboot/host_shutdown/restore_full/restore_partial, update.install, group.remove. False (default) performs no action for those instead and returns a confirmation prompt; ignored for every other service.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / data / description
      Added value: +"Service data: fields plus targets (entity_id/area_id/device_id). Omit for a call that needs no data."
    • addedInput schema / properties / domain / description
      Added value: +"Service domain to call, e.g. 'light' or 'climate'."
    • addedInput schema / properties / service / description
      Added value: +"Service name within the domain, e.g. 'turn_on' or 'set_temperature'."
  2. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true, openWorldHint=true and idempotentHint=false, so the safety profile is covered; the description goes well beyond by disclosing the domain/service regex validation, the self-add-on block list, the eight confirm-guarded services (a human-in-the-loop checkpoint, not a security boundary), and the exact error shapes. This is rich behavioral context an agent cannot get from the schema or annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense but front-loaded: the HTTP mechanics come first, then use/not-for guidance, then returns and errors. Every sentence carries information, though the guard/block enumerations make it longer than strictly necessary for a single-sentence summary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, and the description still concisely notes the return value (list of states changed) plus the three documented error cases. Given the complexity of an arbitrary-service-dispatch tool, nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning: it explains that data holds both fields and targets, that the domain/service must match [A-Za-z0-9_]+ or be refused pre-request, and details the confirm flag semantics and the specific guarded services it applies to.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (call any Home Assistant action by domain/service over HTTP) and names the exact endpoint path. It clearly positions itself as the generic escape hatch among many specific siblings like entities_turn_on and services_set_light_color, and explicitly names the alternative ws_call_service.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit 'Use when: no dedicated tool exists' and 'Not for: an action returning response data — use ws_call_service', with the distinguishing condition (response-returning actions) spelled out. Both the inclusion and exclusion cases are covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools