integrations_abort_config_flow
Abort an ongoing configuration flow using its flow ID to cancel the integration setup process.
Instructions
Abort a config flow in progress.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flow_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools/integrations.py:56-59 (handler)The handler function for the 'abort_config_flow' tool. It calls the HA WebSocket API to abort a config flow in progress by sending the flow_id to 'config_entries/flow/abort'.
@mcp.tool() def abort_config_flow(flow_id: str) -> dict: """Abort a config flow in progress.""" return ha._ws_call("config_entries/flow/abort", flow_id=flow_id) - tools/integrations.py:56-59 (registration)The tool is registered as an MCP tool via the @mcp.tool() decorator on the FastMCP instance named 'integrations'. It is mounted into the main server at namespace 'integrations' (line 55 of server.py).
@mcp.tool() def abort_config_flow(flow_id: str) -> dict: """Abort a config flow in progress.""" return ha._ws_call("config_entries/flow/abort", flow_id=flow_id) - tools/integrations.py:57-57 (schema)The input schema for the tool is simply a 'flow_id' string parameter. The return type is dict.
def abort_config_flow(flow_id: str) -> dict: - ha_client.py:59-66 (helper)The supporting _ws_call helper function that sends the WebSocket command. It wraps _ws_call_async to work both inside and outside an async event loop.
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() - server.py:55-55 (registration)The integrations MCP server (containing abort_config_flow) is mounted at the 'integrations' namespace in the main server, making the tool accessible as 'integrations_abort_config_flow'.
mcp.mount(integrations_mcp, namespace="integrations")