Skip to main content
Glama
jagan-shanmugam

Climatiq MCP Server

procurement-emission

Calculate Scope 3.1 emissions from procurement spending using economic input-output life cycle assessment methods to measure carbon impact.

Instructions

Calculate Scope 3.1 emissions from procurement spending using economic input-output life cycle assessment methods.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesAmount of money spent
currencyNoCurrency code (e.g., USD, EUR, GBP)USD
countryNoCountry code where purchases were madeUS
categoryYesProcurement category (e.g., electronics, food, construction)

Implementation Reference

  • The core handler function that executes the 'procurement-emission' tool logic, calculating Scope 3.1 procurement emissions using Climatiq API based on spend amount, category, currency, and country.
    async def procurement_emission_tool(config, arguments, server, climatiq_request):
        """
        Calculate carbon emissions from procurement and spending.
        
        This tool estimates the greenhouse gas emissions associated with purchasing goods 
        and services (Scope 3, Category 1 emissions). It uses an Economic Input-Output 
        Life Cycle Assessment (EIO-LCA) approach, where emissions are estimated based on:
        - The amount of money spent
        - The spending category (e.g., electronics, food, construction)
        - The currency used
        - The country where purchases are made
        
        This method is especially useful for calculating Scope 3.1 emissions when detailed 
        activity data is not available, providing a practical way to estimate the carbon 
        footprint of an organization's supply chain.
        """
        amount = arguments.get("amount")
        currency = arguments.get("currency", "USD")
        country = arguments.get("country", "US")
        category = arguments.get("category", "")
        
        if not amount or not category:
            raise ValueError("Missing required parameters for procurement emission calculation")
            
        # Construct the request to the Climatiq API
        request_data = {
            "emission_factor": {
                "activity_id": f"purchase_{category}",
                "region": country,
                "data_version": config["data_version"]
            },
            "parameters": {
                "money": amount,
                "money_unit": currency
            }
        }
        
        try:
            result = await climatiq_request("/data/v1/estimate", request_data)
            
            # Store in cache
            cache_id = f"procurement_{category}_{amount}_{currency}_{country}_{id(result)}"
            
            co2e = result.get("co2e", 0)
            co2e_unit = result.get("co2e_unit", "kg")
            
            result_text = f"Procurement spending of {amount} {currency} on {category} in {country} "
            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 category or country. "
                error_text += "Try searching for the correct emission factor first with a query like 'purchase'."
                return error_text, None, None
            else:
                raise
  • The tool registration in get_tool_definitions(), defining the name, description, and input schema for 'procurement-emission'.
    types.Tool(
        name="procurement-emission",
        description="Calculate Scope 3.1 emissions from procurement spending using economic input-output life cycle assessment methods.",
        inputSchema={
            "type": "object",
            "properties": {
                "amount": {"type": "number", "description": "Amount of money spent"},
                "currency": {"type": "string", "description": "Currency code (e.g., USD, EUR, GBP)", "default": "USD"},
                "country": {"type": "string", "description": "Country code where purchases were made", "default": "US"},
                "category": {"type": "string", "description": "Procurement category (e.g., electronics, food, construction)"},
            },
            "required": ["amount", "category"],
        },
    ),
  • Dispatch logic in the MCP server's call_tool handler that routes 'procurement-emission' calls to the procurement_emission_tool function.
    elif name == "procurement-emission":
        result_text, result, cache_id = await procurement_emission_tool(config, arguments, server, climatiq_request)
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. While it explains the calculation method, it doesn't describe what the tool returns (emissions in what units?), whether it makes external API calls, error handling, or performance characteristics. For an emission calculation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 communicates the core purpose without any wasted words. It's appropriately sized for the tool's complexity and gets straight to the point.

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?

For a calculation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns (emissions values, units, confidence intervals), how results should be interpreted, or any limitations of the economic input-output method. Given the complexity of emission calculations, more context is needed.

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 schema has 100% description coverage, so all parameters are documented in the schema itself. The description adds no additional parameter information beyond what's already in the schema descriptions. This meets the baseline of 3 when schema coverage is complete.

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

Purpose5/5

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

The description clearly states the specific action ('Calculate'), the target ('Scope 3.1 emissions from procurement spending'), and the method ('using economic input-output life cycle assessment methods'). It distinguishes this tool from siblings like 'electricity-emission' or 'freight-emission' by focusing specifically on procurement emissions.

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 like 'custom-emission-calculation' or 'search-emission-factors'. It doesn't mention prerequisites, limitations, or typical use cases beyond the basic purpose.

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