Skip to main content
Glama
homeassistant-ai

Home Assistant MCP Server

Official

Create or Update Category

ha_config_set_category
Destructive

Create or update a Home Assistant category to organize automations, scripts, scenes, or helpers within a domain, then assign it to entities.

Instructions

Create or update a Home Assistant category.

Creates a new category if category_id is not provided, or updates an existing category if category_id is provided.

Categories are domain-scoped organizational groups for automations, scripts, scenes, and helpers. Unlike labels (which are cross-domain), categories are specific to a single domain scope.

EXAMPLES:

  • Create automation category: ha_config_set_category("Lighting", scope="automation")

  • Create with icon: ha_config_set_category("Security", scope="automation", icon="mdi:shield")

  • Update category: ha_config_set_category("Updated Name", scope="automation", category_id="my_category_id")

After creating a category, use ha_set_entity(categories={"automation": "category_id"}) to assign it.

If a Claude Desktop user gets a 4-minute timeout with no result on this call, read the target back before repeating it, and tell them to wait a few seconds before clicking the manual-approve button, as clicking it too quickly is known to cause hangs in Claude Desktop. This workaround is specific to Claude Desktop.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
iconNoMaterial Design Icon (e.g., 'mdi:tag', 'mdi:label')
nameYesDisplay name for the category
scopeYesDomain scope for the category (e.g., 'automation', 'script', 'scene', 'helpers').
category_idNoCategory ID for updates.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv8.6.0
    • changedInput schema / properties / category_id / description
      Previous value: -"Category ID for updates. If not provided, creates a new category."New value: +"Category ID for updates."
  2. First observedv7.14.2

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, so the safety profile is covered. The description adds genuinely non-schema context: the create-vs-update branch, and an unusually specific Claude Desktop approval-timeout workaround with recovery guidance. It stops short of stating what an update overwrites (e.g., replacing name/icon on an existing category), which would matter given destructiveHint=true.

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?

Purpose and the create/update rule are front-loaded, and the worked examples are compact and directly useful. The closing Claude Desktop timeout paragraph is long relative to its narrow applicability, but it is clearly set apart and does not bury the primary instruction.

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?

With an output schema present, return values need no explanation, and the description covers mode selection, scope semantics, and the assignment follow-up. Minor gaps remain around valid scope values beyond the examples and what an update replaces, neither of which is fatal for a 4-parameter config tool.

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 100%, so the baseline is 3. The description goes beyond the schema by explaining the operational semantics of category_id — omitting it creates, supplying it updates — where the schema only says 'Category ID for updates.' Examples also demonstrate scope and icon usage in context.

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 (create or update) and resource (Home Assistant category), and explicitly names the conditional that selects the mode: omitted category_id means create, present means update. It further distinguishes categories from the sibling concept labels ('unlike labels, categories are domain-scoped'), so an agent can route correctly without opening schemas.

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

Usage Guidelines4/5

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

Gives clear context for both modes and a concrete follow-up path ('use ha_set_entity(categories=...) to assign it'), which resolves the common 'what next' question. It contrasts categories with labels, an implicit when-to-use guide. It does not name ha_config_get_category or ha_config_remove_category as the read/delete alternatives, so routing for those operations is left to inference.

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