Skip to main content
Glama

custom-emission-calculation

Calculate carbon emissions by entering an activity ID, value, and unit. Use this tool for precise emission calculations with specific factors, enabling tailored climate impact insights.

Instructions

Calculate emissions using any specific emission factor identified by its activity_id, allowing for precise and flexible carbon calculations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activity_idYesEmission factor activity ID (found via search-emission-factors)
unitYesActivity unit (e.g., kWh, km, kg, etc.)
valueYesActivity value (amount of the activity)

Implementation Reference

  • Handler dispatch point for the 'custom-emission-calculation' tool within the MCP server's call_tool handler. It invokes the specific tool function with configuration, arguments, server context, and the API request helper.
    elif name == "custom-emission-calculation": result_text, result, cache_id = await custom_emission_calculation_tool(config, arguments, server, climatiq_request)
  • Import of the custom_emission_calculation_tool function from the tools module, along with other tool handlers and get_tool_definitions (likely containing schemas).
    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 )
  • Client-side helper method demonstrating usage of the 'custom-emission-calculation' tool, showing expected input parameters: activity_id, value, unit.
    async def calculate_custom_emission(self, activity_id, value, unit): """Calculate emissions using a specific emission factor by activity ID""" try: logger.debug(f"Custom emission calculation request: activity_id={activity_id}, value={value}, unit={unit}") result = await self.session.call_tool( "custom-emission-calculation", { "activity_id": activity_id, "value": value, "unit": unit } ) return self._parse_text_content(result) except Exception as e: logger.error(f"Error in custom emission calculation: {e}") return f"Error calculating custom emissions: {e}"

Other Tools

Related 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