Skip to content

Add ha_remove_entity tool (config/entity_registry/remove) #874

Description

@Patch76

What problem does this solve?

When a helper or device is deleted, core.entity_registry sometimes retains a stale entry. There is currently no ha-mcp tool to remove an individual entity registry entry.

Why not existing tools?

  • ha_config_remove_helper: removes the helper config entry, does not target the entity registry directly
  • ha_remove_device: targets devices, not individual entity entries
  • ha_set_entity(enabled=False): hides the entity, does not remove the registry entry

The API path

HA Core WebSocket:

type: config/entity_registry/remove
entity_id: <entity_id>

Implementation: registry.async_remove(entity_id) — no platform check, works for orphaned entries as long as entity_id exists in the registry.

Proposed tool

ha_remove_entity(entity_id: str)

  • Sends config/entity_registry/remove via WebSocket
  • Returns error if entity not found
  • No HA restart required

Context

Came up in homeassistant-ai/skills#39, where direct .storage/ manipulation was proposed as a workaround. The right fix is a proper tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions