estimate_electricity
Pack: carbon-interface · Endpoint: https://gateway.pipeworx.io/carbon-interface/mcp
No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/estimate_electricity for the schema, then POST the same URL with its arguments for the data.
Estimate CO2 emissions from electricity usage. Returns carbon emissions in grams, kg, and metric tons. Example: estimate_electricity(500, “us”, “kwh”) for 500 kWh in the US.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
_apiKey | string | yes | Carbon Interface API key |
value | number | yes | Amount of electricity consumed (e.g., 500) |
country | string | yes | ISO 3166-1 alpha-2 country code (e.g., “us”, “gb”, “de”) |
unit | string | no | Unit of electricity: “kwh” or “mwh” (default: “kwh”) |
state | string | no | US state code for more precise estimate (e.g., “ca”, “ny”). Only for US. |
Example call
Arguments
{
"_apiKey": "your-carbon-interface-api-key",
"value": 500,
"country": "us",
"unit": "kwh"
}
curl
curl -X POST https://gateway.pipeworx.io/carbon-interface/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"estimate_electricity","arguments":{"_apiKey":"your-carbon-interface-api-key","value":500,"country":"us","unit":"kwh"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('estimate_electricity', {
"_apiKey": "your-carbon-interface-api-key",
"value": 500,
"country": "us",
"unit": "kwh"
});
More examples
{
"_apiKey": "your-carbon-interface-api-key",
"value": 150,
"country": "us",
"state": "ca",
"unit": "kwh"
}
Response shape
Always returns: electricity_value, electricity_unit, country, state, estimated_at, carbon_g, carbon_kg, carbon_mt, carbon_lb
| Field | Type | Description |
|---|---|---|
electricity_value | number | Amount of electricity consumed |
electricity_unit | string | Unit of electricity (kwh or mwh) |
country | string | ISO 3166-1 alpha-2 country code |
state | string | null | US state code if provided |
estimated_at | string | null | ISO timestamp of estimate |
carbon_g | number | null | Carbon emissions in grams |
carbon_kg | number | null | Carbon emissions in kilograms |
carbon_mt | number | null | Carbon emissions in metric tons |
carbon_lb | number | null | Carbon emissions in pounds |
Full JSON Schema
{
"type": "object",
"properties": {
"electricity_value": {
"type": "number",
"description": "Amount of electricity consumed"
},
"electricity_unit": {
"type": "string",
"description": "Unit of electricity (kwh or mwh)"
},
"country": {
"type": "string",
"description": "ISO 3166-1 alpha-2 country code"
},
"state": {
"type": [
"string",
"null"
],
"description": "US state code if provided"
},
"estimated_at": {
"type": [
"string",
"null"
],
"description": "ISO timestamp of estimate"
},
"carbon_g": {
"type": [
"number",
"null"
],
"description": "Carbon emissions in grams"
},
"carbon_kg": {
"type": [
"number",
"null"
],
"description": "Carbon emissions in kilograms"
},
"carbon_mt": {
"type": [
"number",
"null"
],
"description": "Carbon emissions in metric tons"
},
"carbon_lb": {
"type": [
"number",
"null"
],
"description": "Carbon emissions in pounds"
}
},
"required": [
"electricity_value",
"electricity_unit",
"country",
"state",
"estimated_at",
"carbon_g",
"carbon_kg",
"carbon_mt",
"carbon_lb"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"carbon-interface": {
"url": "https://gateway.pipeworx.io/carbon-interface/mcp"
}
}
}
See Getting Started for client-specific install steps.