get_credits
Check remaining credits for the authenticated user to monitor usage and manage access to RevenueBase MCP server resources.
Instructions
Retrieves the number of remaining credits for the authenticated user.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:44-54 (handler)The handler function that implements the get_credits tool logic by querying the Revenuebase API for the user's remaining credits.def get_credits() -> dict: """ Retrieves the number of remaining credits for the authenticated user. """ if not api_key: raise RuntimeError("Environment variable REVENUEBASE_API_KEY is not set") url = "https://api.revenuebase.ai/v1/credits" headers = {"x-key": api_key, "Accept": "application/json"} resp = requests.get(url, headers=headers, verify=False) resp.raise_for_status() return resp.json()
- server.py:43-43 (registration)The decorator that registers the get_credits function as an MCP tool.@mcp.tool()