set-api-key
Configure the Climatiq API key to enable authenticated requests for carbon emissions calculations and climate impact insights via the Climatiq MCP Server.
Instructions
Set the Climatiq API key for authentication. This allows the server to make authorized requests to the Climatiq API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_key | Yes | Your Climatiq API key obtained from app.climatiq.io |
Implementation Reference
- Dispatches calls to the 'set-api-key' tool by invoking the set_api_key_tool function with config, arguments, server, and climatiq_request function.if name == "set-api-key": result_text = await set_api_key_tool(config, arguments, server, climatiq_request)
- src/climatiq_mcp_server/server.py:224-229 (registration)Registers the 'set-api-key' tool (among others) by returning tool definitions via get_tool_definitions() in the list_tools handler.@server.list_tools() async def handle_list_tools() -> list[types.Tool]: """ List available tools for interacting with the Climatiq API. """ return get_tool_definitions()
- Checks for API key presence and directs users to use the set-api-key tool if missing.if not config["api_key"]: raise ValueError("Climatiq API key not set. Please configure it using the set-api-key tool.")