get_version
Retrieve the current Home Assistant version number to verify system compatibility and check for available updates.
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 function for the 'get_version' tool. Registered via @mcp.tool() decorator. Logs execution and delegates to the get_hass_version helper function.@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-170 (helper)Helper function that implements the core logic: fetches Home Assistant configuration via API and extracts the version string.@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")