Skip to main content
Glama

call_service_tool

Call any Home Assistant service to control entities and run automation tasks. Pass a domain, service, and optional data to trigger actions like turning on lights or reloading automations.

Instructions

Call any Home Assistant service (low-level API access)

Args: domain: The domain of the service (e.g., 'light', 'switch', 'automation') service: The service to call (e.g., 'turn_on', 'turn_off', 'toggle') data: Optional data to pass to the service (e.g., {'entity_id': 'light.living_room'})

Returns: A dictionary with success status, the domain/service called, and the list of affected entity states returned by Home Assistant. Failed calls also include an error message.

Examples: domain='light', service='turn_on', data={'entity_id': 'light.x', 'brightness': 255} domain='automation', service='reload' domain='fan', service='set_percentage', data={'entity_id': 'fan.x', 'percentage': 50}

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "domain": "<domain>",
      "service": "<service>"
    },
    "name": "call_service_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataNo
domainYes
serviceYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.4.1
    • changedInput schema / properties / data / anyOf
      Previous value: -[
      -  {
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "result": {
      +      "additionalProperties": true,
      +      "title": "Result",
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "result"
      +  ],
      +  "title": "call_service_toolOutput",
      +  "type": "object"
      +}
  2. First observed

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does describe the return shape including error reporting for failed calls. What it omits is the behavioral profile of a mutation tool: that it invokes an action with real side effects on devices, whether permissions are required, and whether calls are idempotent. The 'Returns' block is also largely redundant given an output schema exists.

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?

The front-loaded one-line summary is followed by Args, Returns, and Examples sections that are each short and useful. The Returns section is somewhat wasted given an output schema, but overall there is little filler.

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

Completeness4/5

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

For a three-parameter low-level escape hatch with an output schema, the description supplies purpose, argument meaning, return behavior, and runnable examples, which is close to sufficient. The main remaining gap is guidance on when to prefer higher-level sibling tools and disclosure of side effects for a mutating call.

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 description coverage is 0%, so the description must compensate, and it does: each of the three parameters is explained with meaning and concrete example values, including the shape of the free-form 'data' object. It does not enumerate valid domains/services dynamically, but the examples make the expected syntax clear.

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

Purpose4/5

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

The description states a specific verb and resource ('Call any Home Assistant service') and frames it as 'low-level API access', which implicitly distinguishes it from the higher-level entity/dashboard siblings. It stops short of naming a sibling or explicitly drawing the boundary, but the purpose is unambiguous.

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

Usage Guidelines3/5

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

Calling it 'low-level API access' hints that this is the generic escape hatch for operations not covered by dedicated tools, and the examples show typical invocations. However, there is no explicit when-to-use vs when-to-prefer-a-sibling rule, no statement about when a specialized tool (e.g., entity_action) should be chosen instead, and no prerequisites.

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