integrations_disable_integration
Disable a Home Assistant integration entry without deleting its configuration. Provide the entry ID to deactivate the integration.
Instructions
Disable an integration config entry without removing it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entry_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools/integrations.py:74-81 (handler)The handler function for the 'disable_integration' tool (which maps to 'integrations_disable_integration' when mounted under namespace 'integrations'). It calls Home Assistant's WebSocket API 'config_entries/disable' with disabled_by='user' to disable an integration config entry.
@mcp.tool() def disable_integration(entry_id: str) -> dict: """Disable an integration config entry without removing it.""" return ha._ws_call( "config_entries/disable", entry_id=entry_id, disabled_by="user", ) - tools/integrations.py:6-9 (registration)The FastMCP instance 'mcp' is created and the @mcp.tool() decorator registers the disable_integration function as a tool.
from fastmcp import FastMCP import ha_client as ha mcp = FastMCP("integrations") - server.py:55-55 (registration)The integrations FastMCP instance is mounted under the 'integrations' namespace, so the 'disable_integration' tool becomes available as 'integrations_disable_integration'.
mcp.mount(integrations_mcp, namespace="integrations") - ha_client.py:59-66 (helper)The _ws_call helper function that sends the 'config_entries/disable' command over WebSocket to Home Assistant.
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()