integrations_update_integration_entry
Update an existing integration entry's title, disable new entities, or disable polling to customize Home Assistant integration behavior.
Instructions
Update properties of an existing config entry (title, polling preferences).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entry_id | Yes | ||
| title | No | ||
| pref_disable_new_entities | No | ||
| pref_disable_polling | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools/integrations.py:120-135 (handler)The `update_integration_entry` function is the handler for the 'integrations_update_integration_entry' tool. It updates an existing Home Assistant config entry by calling the WebSocket API method 'config_entries/update' with optional title, pref_disable_new_entities, and pref_disable_polling parameters. It is decorated with @mcp.tool() so it auto-registers as an MCP tool.
@mcp.tool() def update_integration_entry( entry_id: str, title: str | None = None, pref_disable_new_entities: bool | None = None, pref_disable_polling: bool | None = None, ) -> dict: """Update properties of an existing config entry (title, polling preferences).""" payload: dict = {"entry_id": entry_id} if title is not None: payload["title"] = title if pref_disable_new_entities is not None: payload["pref_disable_new_entities"] = pref_disable_new_entities if pref_disable_polling is not None: payload["pref_disable_polling"] = pref_disable_polling return ha._ws_call("config_entries/update", **payload) - server.py:55-55 (registration)The 'integrations' namespace is mounted on the main MCP server at line 55, meaning this tool becomes accessible as 'integrations_update_integration_entry' (namespace + tool name).
mcp.mount(integrations_mcp, namespace="integrations") - tools/integrations.py:9-9 (registration)The integrations MCP server is created with the name 'integrations'. The @mcp.tool() decorator on update_integration_entry registers it as a tool within this server.
mcp = FastMCP("integrations") - ha_client.py:59-66 (helper)The `_ws_call` helper function sends a WebSocket call to Home Assistant with the specified message type and keyword arguments. The 'update_integration_entry' handler calls this with msg_type='config_entries/update'.
def _ws_call(msg_type: str, **kwargs) -> Any: try: asyncio.get_running_loop() except RuntimeError: return asyncio.run(_ws_call_async(msg_type, **kwargs)) import concurrent.futures with concurrent.futures.ThreadPoolExecutor() as pool: return pool.submit(asyncio.run, _ws_call_async(msg_type, **kwargs)).result() - ha_client.py:37-57 (helper)The `_ws_call_async` helper function that actually opens a WebSocket connection to Home Assistant, authenticates, sends the message (e.g., 'config_entries/update'), and returns the result.
async def _ws_call_async(msg_type: str, **kwargs) -> Any: import websockets token = _HA_TOKEN # max_size=None disables the 1 MB frame cap — HACS repository lists, # large registries and full traces routinely exceed that. async with websockets.connect(_ws_url(), max_size=None) as ws: greeting = json.loads(await ws.recv()) assert greeting["type"] == "auth_required" await ws.send(json.dumps({"type": "auth", "access_token": token})) auth_ok = json.loads(await ws.recv()) if auth_ok["type"] != "auth_ok": raise RuntimeError(f"WS auth failed: {auth_ok}") payload = {"id": 1, "type": msg_type, **kwargs} await ws.send(json.dumps(payload)) while True: data = json.loads(await asyncio.wait_for(ws.recv(), timeout=10)) if data.get("id") == 1 and data.get("type") == "result": if not data.get("success"): raise RuntimeError(f"WS error: {data.get('error')}") return data["result"]