Skip to main content
Glama

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)

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