get_price_and_home_info
Retrieve current and forecasted electricity prices with breakdowns, price levels, and home information including address and timezone from your Tibber energy account.
Instructions
Get the infomation of: 1. current price, with price break down, price level, and currency 2. hourly price and price level of today 3. hourly price and price level of tomorrow 4. home address info, timezone etc the currency is applying to all prices
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:21-47 (handler)The main handler function that implements the 'get_price_and_home_info' tool logic. It connects to the Tibber API, fetches home and price information, and returns it as a string.async def get_price_and_home_info() -> str: """Get the infomation of: 1. current price, with price break down, price level, and currency 2. hourly price and price level of today 3. hourly price and price level of tomorrow 4. home address info, timezone etc the currency is applying to all prices """ try: tibber_connection = tibber.Tibber(tibber_api_token, user_agent="tibber-mcp") await tibber_connection.update_info() homes = tibber_connection.get_homes() if not homes: logger.error("No homes found for this Tibber account") return "No homes found" home = homes[0] await home.update_info_and_price_info() #using predefined query UPDATE_INFO_PRICE for getting most of info such as current price, today and tomorrow price, home info and subscription etc result = home.info await tibber_connection.close_connection() return str(result) except Exception as e: logger.error(f"Error retrieving price info: {e}") return f"Error: {str(e)}"
- server.py:20-20 (registration)The @mcp.tool() decorator registers the get_price_and_home_info function as an MCP tool.@mcp.tool()