Skip to main content
Glama
jagan-shanmugam

Climatiq MCP Server

cloud-computing-emission

Calculate carbon emissions from cloud computing usage by provider, service, and region to assess digital environmental impact.

Instructions

Calculate emissions from cloud computing services by provider, service type, and region to assess digital carbon footprint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
providerYesCloud provider (aws, azure, gcp)
serviceYesCloud service (e.g., compute, storage, database)
regionYesCloud region (e.g., us-east-1, europe-west1)
usage_amountYesAmount of cloud resources used
usage_unitYesUnit for cloud resource (e.g., kWh, GB-hours, CPU-hours)

Implementation Reference

  • The async handler function that executes the tool logic: extracts parameters, constructs Climatiq API request with dynamic activity_id, calls API, formats response, handles errors.
    async def cloud_computing_emission_tool(config, arguments, server, climatiq_request):
        """
        Calculate carbon emissions from cloud computing resource usage.
        
        This specialized tool estimates the carbon footprint of cloud computing services across
        major providers (AWS, Azure, GCP). It accounts for:
        - The specific cloud provider (affects emission factors)
        - The type of service used (compute, storage, networking, etc.)
        - The region/data center location (significant regional variations in grid emissions)
        - Usage amount and units (CPU hours, GB-months, etc.)
        
        This tool helps organizations understand and measure the environmental impact of 
        their cloud infrastructure and can support sustainable cloud deployment decisions.
        """
        provider = arguments.get("provider")
        service = arguments.get("service")
        region = arguments.get("region")
        usage_amount = arguments.get("usage_amount")
        usage_unit = arguments.get("usage_unit")
        
        if not provider or not service or not region or not usage_amount or not usage_unit:
            raise ValueError("Missing required parameters for cloud computing emission calculation")
            
        # Construct the request to the Climatiq API
        request_data = {
            "emission_factor": {
                "activity_id": f"cloud_computing-{provider}-{service}-{region}",
                "data_version": config["data_version"]
            },
            "parameters": {
                usage_unit: usage_amount
            }
        }
        
        try:
            result = await climatiq_request("/data/v1/estimate", request_data)
            
            # Store in cache
            cache_id = f"cloud_{provider}_{service}_{region}_{usage_amount}_{usage_unit}_{id(result)}"
            
            co2e = result.get("co2e", 0)
            co2e_unit = result.get("co2e_unit", "kg")
            
            result_text = f"Cloud computing usage of {usage_amount} {usage_unit} with {provider} {service} in {region} "
            result_text += f"results in {co2e} {co2e_unit} of CO2e emissions."
            result_text += f"\n\nDetailed results are available as a resource with ID: {cache_id}"
            
            return result_text, result, cache_id
            
        except ValueError as e:
            if "API request failed" in str(e):
                error_text = f"Error calculating emissions: {str(e)}\n\n"
                error_text += "This might be due to an unsupported provider/service/region combination. "
                error_text += "Try searching for the correct emission factor first using the search-emission-factors tool with a query like 'cloud_computing'."
                return error_text, None, None
            else:
  • The input schema definition for the tool, specifying parameters and requirements, returned by get_tool_definitions().
    types.Tool(
        name="cloud-computing-emission",
        description="Calculate emissions from cloud computing services by provider, service type, and region to assess digital carbon footprint.",
        inputSchema={
            "type": "object",
            "properties": {
                "provider": {"type": "string", "description": "Cloud provider (aws, azure, gcp)"},
                "service": {"type": "string", "description": "Cloud service (e.g., compute, storage, database)"},
                "region": {"type": "string", "description": "Cloud region (e.g., us-east-1, europe-west1)"},
                "usage_amount": {"type": "number", "description": "Amount of cloud resources used"},
                "usage_unit": {"type": "string", "description": "Unit for cloud resource (e.g., kWh, GB-hours, CPU-hours)"},
            },
            "required": ["provider", "service", "region", "usage_amount", "usage_unit"],
        },
    ),
  • Registration and dispatch to the handler in the MCP server's call_tool handler.
    elif name == "cloud-computing-emission":
        result_text, result, cache_id = await cloud_computing_emission_tool(config, arguments, server, climatiq_request)
  • Import of the tool handler function from tools.py module.
    from climatiq_mcp_server.tools import (
        set_api_key_tool,
        electricity_emission_tool,
        travel_emission_tool,
        search_emission_factors_tool,
        custom_emission_calculation_tool,
        cloud_computing_emission_tool,
        freight_emission_tool,
        procurement_emission_tool,
        hotel_emission_tool,
        travel_spend_tool,
        get_tool_definitions
    )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the calculation function but lacks details on permissions, rate limits, error handling, or output format. For a tool with 5 required parameters and no output schema, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary details. Every word contributes to explaining the tool's function, making it appropriately sized and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a 5-parameter tool with no annotations and no output schema, the description is incomplete. It fails to explain return values, error conditions, or behavioral traits, leaving the agent with insufficient information to effectively invoke the tool beyond basic parameter input.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting all 5 parameters. The description adds minimal value beyond the schema by listing provider, service type, and region as key inputs, but it does not provide additional context like valid examples or constraints, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('calculate') and resource ('emissions from cloud computing services'), and it mentions key parameters (provider, service type, region) to assess digital carbon footprint. However, it does not explicitly differentiate from sibling tools like 'custom-emission-calculation' or 'search-emission-factors', which might handle similar emission calculations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions assessing digital carbon footprint but does not specify scenarios, prerequisites, or exclusions compared to sibling tools such as 'electricity-emission' or 'procurement-emission', leaving the agent without clear usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/jagan-shanmugam/climatiq-mcp-server'

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