get_version
Retrieve the current version of Home Assistant using a direct query tool, enabling AI assistants to access version details for system compatibility and integration purposes.
Instructions
Get the Home Assistant version
Returns: A string with the Home Assistant version (e.g., "2025.3.0")
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- app/server.py:48-59 (handler)The primary handler for the 'get_version' MCP tool. Registered with @mcp.tool() and logged via @async_handler. Delegates to the get_hass_version helper from app.hass module.@mcp.tool() @async_handler("get_version") async def get_version() -> str: """ Get the Home Assistant version Returns: A string with the Home Assistant version (e.g., "2025.3.0") """ logger.info("Getting Home Assistant version") return await get_hass_version()
- app/hass.py:162-169 (helper)Core helper function that performs the actual API call to retrieve Home Assistant version from /api/config endpoint, with error handling.@handle_api_errors async def get_hass_version() -> str: """Get the Home Assistant version from the API""" client = await get_client() response = await client.get(f"{HA_URL}/api/config", headers=get_ha_headers()) response.raise_for_status() data = response.json() return data.get("version", "unknown")
- app/server.py:48-59 (registration)The @mcp.tool() decorator registers this function as the 'get_version' tool in the MCP server.@mcp.tool() @async_handler("get_version") async def get_version() -> str: """ Get the Home Assistant version Returns: A string with the Home Assistant version (e.g., "2025.3.0") """ logger.info("Getting Home Assistant version") return await get_hass_version()