# PG&E Public Datasets MCP

> PG&E Public Datasets provides direct access to PG&E public energy data via MCP. You can pull historical monthly usage, analyze billing costs by ZIP code and customer type, compare regional electricity and gas consumption side-by-side, and track efficiency program savings—all without needing an API key.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** energy-consumption, billing-trends, efficiency-savings, public-data, utility-data

## Description

The **PG&E Public Datasets MCP Server - Energy Analysis** gives your AI client direct access to PG&E's public energy metrics. You don't need an API key or complex setup; you just connect, and your agent calls the tools to pull structured data.

When you wanna look at regional differences, use **compare_regions**. This tool lets you compare usage figures, customer counts, and average bills across several specified ZIP codes in a single output. If you're tracking electricity consumption for multiple spots, **get_electricity_by_zip** pulls that data for any list of ZIP codes, breaking it down by month or year. For natural gas, **get_gas_by_zip** does the same thing, retrieving consumption data for specific ZIP codes, whether you need monthly numbers or annual totals.

To analyze what's happening over time, you can run two tools: **get_monthly_usage** gives you detailed electric (kWh) and gas (therms) usage by a specific ZIP code, month, year, *and* customer segment. If you wanna spot long-term patterns instead of just monthly snapshots, **get_yearly_trends** tracks how overall electricity or gas usage has shifted over multiple years. This lets you see if demand is growing steady or spiking seasonally.

For billing and cost analysis, start with **get_billing_data**. It retrieves average utility bills and cost metrics based on specific ZIP codes or different customer segments. You can also pinpoint consumption by type—**get_usage_by_customer_type** shows total electric or gas usage broken down for Residential, Commercial, Industrial, and Agricultural sectors. If you need to track what people are spending on energy efficiency, **get_savings_data** provides data on those program savings, including counts of participation, the saved amounts, and associated costs.

Grouping these tools together lets you build a full picture:

*   You can run **get_monthly_usage** to get granular details for every ZIP code. Then, use **compare_regions** to aggregate those findings across multiple locations. You'll see the electric (kWh) and gas (therms) consumption side-by-side, along with customer counts and average bills.
*   If you want to compare affordability, you can check out **get_billing_data** for a specific segment—say, Industrial users in ZIP 90210—and then use **get_usage_by_customer_type** to see if that high cost corresponds with actual usage volume.
*   To study the impact of government or utility programs, you'll pair **get_savings_data** (showing saved amounts) with a regional comparison run using **compare_regions**. This lets you measure which areas got the best return on investment. 

When your agent runs these tools, it gives you structured energy metrics that let you determine energy affordability and compare costs across different ZIP codes or specific customer types. You're always working with raw numbers—the full electric (kWh) and gas (therms) usage by **get_usage_by_customer_type** for major sectors, the historical data from **get_yearly_trends**, and the immediate comparison capability of **compare_regions**. It’s all public data, straight to your client.

## Tools

### get_billing_data
Retrieves average utility bills and cost metrics based on specific ZIP codes or customer segments.

### get_usage_by_customer_type
Shows total electric or gas consumption broken down by the major customer types (Residential, Commercial, Industrial, Agricultural).

### compare_regions
Compares usage, customer counts, and average bills across several specified ZIP codes in a single output.

### get_electricity_by_zip
Gets electricity consumption data for a list of ZIP codes, broken down by month or year.

### get_gas_by_zip
Retrieves natural gas consumption data for specific ZIP codes, monthly or annually.

### get_monthly_usage
Outputs detailed electric (kWh) and gas (therms) usage by ZIP code, month, year, and customer segment.

### get_savings_data
Provides data on energy efficiency program savings, including counts, saved amounts, and associated costs.

### get_yearly_trends
Tracks how overall electricity and gas usage has changed over multiple years to spot long-term patterns.

## Prompt Examples

**Prompt:** 
```
Show monthly electricity usage by customer type.
```

**Response:** 
```
Monthly electricity usage breakdown: Residential avg 650 kWh/month ($95), Commercial avg 4,200 kWh/month ($580), Industrial avg 45,000 kWh/month ($4,800), Agricultural avg 12,000 kWh/month ($1,100). Residential represents 35% of total consumption, Commercial 40%, Industrial 15%, Agricultural 10%.
```

**Prompt:** 
```
Compare ZIP codes 94102, 94301, and 95054.
```

**Response:** 
```
Regional comparison: 94102 (SF Mission): 5.2M kWh/month, 42K customers, avg $138 bill. 94301 (Palo Alto): 4.8M kWh/month, 28K customers, avg $165 bill. 95054 (Santa Clara): 6.1M kWh/month, 35K customers, avg $152 bill. Palo Alto has highest per-customer usage despite fewer customers, likely due to larger homes and higher income.
```

**Prompt:** 
```
Show yearly energy consumption trends.
```

**Response:** 
```
Yearly trends (2020-2024): 2020: 82,400 GWh (pandemic dip), 2021: 85,100 GWh (+3.3%), 2022: 87,800 GWh (+3.2%), 2023: 86,200 GWh (-1.8%, mild weather), 2024: 89,500 GWh (+3.8%, data center growth). Gas trends: declining 2% annually due to electrification and heat pump adoption.
```

## Capabilities

### Compare usage across multiple ZIP codes
Analyze regional differences in electricity use, gas consumption, customer counts, and average utility bills by comparing several locations simultaneously.

### Track billing costs by location and segment
Determine energy affordability and compare average utility costs across different ZIP codes or specific customer types (e.g., Residential vs. Industrial).

### Analyze usage patterns over time
Retrieve detailed monthly consumption data for both electric and gas, broken down by specific ZIP code and customer segment.

### Study long-term energy demand shifts
Establish multi-year trends in overall electricity or gas usage to identify long-term growth rates or seasonal changes.

### Measure efficiency program impact
Calculate the cost-effectiveness and ROI of various energy efficiency programs based on recorded savings data.

## Use Cases

### Identifying areas for electrification
A utility planner runs `get_electricity_by_zip` and compares it to `get_gas_by_zip`. They notice a high ratio of electricity use in ZIP 94102 compared to its gas usage, suggesting that neighborhood is ripe for heat pump or EV infrastructure targeting.

### Assessing market competition
A real estate developer uses `compare_regions` to compare three adjacent ZIP codes. The resulting data shows a significant difference in average bills and usage patterns, helping them predict which area will be more profitable for mixed-use development.

### Analyzing post-pandemic energy shifts
A climate researcher calls `get_monthly_usage` across multiple years. They can isolate the exact drop in Industrial usage after 2020 and model how quickly that segment is recovering its baseline demand.

### Auditing program effectiveness
A clean energy company uses `get_savings_data` to prove a point. They compare the reported savings metrics for two different efficiency programs, determining which one offers better cost-effectiveness per unit of saved energy.

## Benefits

- Compare multiple ZIP codes directly using `compare_regions`. You get side-by-side usage figures, customer counts, and average bills instantly. This eliminates the need to run separate queries for every location.
- Get granular cost data with `get_billing_data`. Instead of just seeing total consumption, you can pinpoint how much different segments pay in specific regions, helping target rate changes.
- Track historical shifts using `get_yearly_trends`. You see if energy demand is growing or declining over five years. This establishes a baseline for any future planning model.
- Understand where the power comes from with `get_usage_by_customer_type`. You immediately know if Commercial usage is driving your total load, which changes your intervention point.
- Calculate ROI using `get_savings_data`. Instead of just guessing how effective a program is, you pull concrete metrics on saved kWh/therms versus program cost.

## How It Works

The bottom line is, you get clean, actionable energy data output that your AI client can read, cross-reference, and use for analysis.

1. Subscribe to this server in Vinkius. Your AI client connects automatically, requiring no API keys.
2. Ask your agent to execute a specific tool (e.g., `get_electricity_by_zip`) and provide the necessary parameters (like ZIP codes or years).
3. The agent runs the query against the public dataset and returns structured data tables detailing consumption metrics.

## Frequently Asked Questions

**How do I use `get_monthly_usage`?**
You pass the desired ZIP code, month, year, and customer segment. The tool returns kWh (for electric) or therms (for gas) consumed for that specific combination.

**What is the best way to compare different regions?**
Use `compare_regions`. Give it a comma-separated list of ZIP codes, and it outputs usage figures, customer counts, and average bills all in one go.

**Can I analyze efficiency program returns?**
Yes, run the `get_savings_data` tool. It gives you metrics on program participation, kWh/therms saved, and costs so you can calculate true ROI.

**`get_usage_by_customer_type` is better than just looking at total data?**
Absolutely. `get_usage_by_customer_type` breaks the load down by Residential, Commercial, Industrial, and Agricultural sectors. This tells you *who* is using the power, which is critical for policy analysis.

**Does running `get_billing_data` require an API key or authentication?**
No, the data is entirely public and requires no keys. You can run any tool without setting up credentials.

**When I use `get_electricity_by_zip`, am I limited to a single ZIP code for comparison?**
No, you pass comma-separated lists of ZIP codes in the request. This lets your agent compare multiple areas simultaneously.

**How do I use `get_monthly_usage` to compare electric and gas usage across different customer types?**
You must call the tool twice: once for 'electric' data type, and again for 'gas'. Then you combine the results in your agent or script.

**What kind of year filters can I use with `get_yearly_trends`?**
The tool accepts a specific YYYY format for filtering. This lets you pinpoint consumption data to exact calendar years for analysis.

**Is any authentication required?**
No! All PG&E Public Datasets are completely free and accessible without any API key or authentication. Just subscribe and start querying energy data immediately.

**What customer segments are available?**
PG&E provides data for four customer segments: Residential (homes), Commercial (businesses), Industrial (manufacturing), and Agricultural (farming). Each segment has different consumption patterns and billing structures.

**Can I compare multiple ZIP codes?**
Yes! Use the compare_regions tool with comma-separated ZIP codes (e.g., "94102,94103,94104"). It returns side-by-side usage data, customer counts, and average bills for each region, making it easy to identify geographic differences in energy consumption.