Skip to main content
Glama
homeassistant-ai

Home Assistant MCP Server

Official

Create or Update Label

ha_config_set_label
Destructive

Create or update a label in Home Assistant to tag and organize entities, devices, and areas for better management and automation.

Instructions

Create or update a Home Assistant label.

Creates a new label if label_id is not provided, or updates an existing label if label_id is provided.

Labels are a flexible tagging system that can be applied to entities, devices, and areas for organization and automation purposes.

EXAMPLES:

  • Create simple label: ha_config_set_label("Critical")

  • Create colored label: ha_config_set_label("Outdoor", color="green")

  • Create label with icon: ha_config_set_label("Battery Powered", icon="mdi:battery")

  • Create full label: ha_config_set_label("Security", color="red", icon="mdi:shield", description="Security-related devices")

  • Update label: ha_config_set_label("Updated Name", label_id="my_label_id", color="blue")

After creating a label, use ha_set_entity(labels=["label_id"]) to assign it to entities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
iconNoMaterial Design Icon (e.g., 'mdi:tag', 'mdi:label')
nameYesDisplay name for the label
colorNoColor for the label (e.g., 'red', 'blue', 'green', or hex like '#FF5733')
label_idNoLabel ID for updates. If not provided, creates a new label.
descriptionNoDescription of the label's purpose

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

The description discloses that the tool modifies state (create/update), consistent with destructiveHint annotation. It adds context about the purpose of labels and how assignments work, going beyond the annotation's simple destructive flag.

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

Conciseness5/5

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

The description is concise, front-loading the core action, followed by a brief explanation and well-structured examples. Every sentence is useful with no redundancy.

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?

Given the schema coverage, annotations, and presence of an output schema, the description is complete. It explains the create/update behavior, provides examples for all parameters, and links to a related tool for assignment.

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?

The input schema covers all 5 parameters with descriptions (100% coverage). The tool description adds value through concrete examples showing how to use parameters like color, icon, and description in context, which aids understanding beyond the schema.

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?

The description clearly states the tool creates or updates a Home Assistant label, with explicit differentiation between create (no label_id) and update (with label_id). It distinguishes from siblings like ha_config_get_label and ha_config_remove_label.

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?

The description explains when to use create vs update based on label_id presence, and provides examples for various use cases. It also advises on subsequent steps (use ha_set_entity to assign). While it doesn't explicitly state when not to use it, sibling tools cover other operations.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/homeassistant-ai/ha-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server