new_api_key
Generate a new API key for secure access and integration with the revenuebase-mcp-server. This tool ensures users can quickly obtain fresh keys for authentication and data interaction.
Instructions
Generates and returns a new API key for the user.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:57-68 (handler)The handler function for the 'new_api_key' MCP tool. It is registered via the @mcp.tool() decorator and implements the logic to generate a new API key by making a GET request to the Revenuebase API using the existing API key.@mcp.tool() def new_api_key() -> dict: """ Generates and returns a new API key for the user. """ if not api_key: raise RuntimeError("Environment variable REVENUEBASE_API_KEY is not set") url = "https://api.revenuebase.ai/v1/new-api-key" headers = {"x-key": api_key, "Accept": "application/json"} resp = requests.get(url, headers=headers, verify=False) resp.raise_for_status() return resp.json()