new_api_key
Generate a new API key to authenticate and access Revenuebase MCP server features and data.
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 complete handler function for the 'new_api_key' MCP tool, including the @mcp.tool() decorator which serves as both the implementation and registration. It makes a GET request to the Revenuebase API to generate and return a new 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()