Skip to main content
Glama

get_consumption_data

Retrieve hourly energy consumption data for the past 30 days, including time periods, total cost, base energy cost, and consumed kWh via the Tibber MCP server.

Instructions

Get the hourly consumption data for the last 30 days, such as time period, total cost, base energy cost, and consumpted kwh.

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "title": "get_consumption_dataArguments", "type": "object" }

Implementation Reference

  • server.py:49-72 (handler)
    The main handler function for the 'get_consumption_data' tool, decorated with @mcp.tool() which also serves as its registration. It connects to the Tibber API, fetches consumption data for the primary home, and returns it as a string.
    @mcp.tool() async def get_consumption_data() -> str: """Get the hourly consumption data for the last 30 days, such as time period, total cost, base energy cost, and consumpted kwh. """ 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.fetch_consumption_data() await tibber_connection.close_connection() result = home.hourly_consumption_data return str(result) except Exception as e: logger.error(f"Error retrieving price info: {e}") return f"Error: {str(e)}"

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/linkcd/tibber-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server