get_workspace_details
Retrieve current BitScale workspace details including plan, credit balances, people/company search limits, and member counts.
Instructions
Get details about the current BitScale workspace — plan info, credit balances, people/company search limits, and member counts.
The workspace is identified automatically from the API key configured during MCP setup. No parameters needed.
Returns: workspace id, name, plan (name, credits_included, billing_interval, next_billing_date, price), credits (total, used, remaining, plan_credits, rollover, topup), people_company_searches (limit, used, remaining), and members (total, owners, admins, editors).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- main.py:68-83 (handler)The handler function for the 'get_workspace_details' tool. Decorated with @mcp.tool(), it calls the BitScale API GET /workspace endpoint and returns the JSON result containing plan info, credit balances, search limits, and member counts.
@mcp.tool() def get_workspace_details() -> str: """ Get details about the current BitScale workspace — plan info, credit balances, people/company search limits, and member counts. The workspace is identified automatically from the API key configured during MCP setup. No parameters needed. Returns: workspace id, name, plan (name, credits_included, billing_interval, next_billing_date, price), credits (total, used, remaining, plan_credits, rollover, topup), people_company_searches (limit, used, remaining), and members (total, owners, admins, editors). """ data = _get("/workspace") return json.dumps(data, indent=2) - main.py:47-53 (helper)The _get() helper function performs the authenticated GET request to the BitScale API, used by get_workspace_details.
def _get(path: str, params: dict | None = None, timeout: int = 30) -> dict: """Perform an authenticated GET request against the BitScale API.""" url = f"{BITSCALE_API_BASE}{path}" with httpx.Client(timeout=timeout) as client: response = client.get(url, headers=_headers(), params=params) response.raise_for_status() return response.json() - main.py:34-44 (helper)The _headers() helper function builds the authentication headers using the API key.
def _headers() -> dict: """Return the auth headers required by the BitScale API.""" if not API_KEY: raise RuntimeError( "BITSCALE_API_KEY environment variable is not set. " "Set it before starting the server." ) return { "X-API-KEY": API_KEY, "Content-Type": "application/json", } - main.py:68-83 (registration)The @mcp.tool() decorator on line 68 registers 'get_workspace_details' as an MCP tool with the FastMCP server.
@mcp.tool() def get_workspace_details() -> str: """ Get details about the current BitScale workspace — plan info, credit balances, people/company search limits, and member counts. The workspace is identified automatically from the API key configured during MCP setup. No parameters needed. Returns: workspace id, name, plan (name, credits_included, billing_interval, next_billing_date, price), credits (total, used, remaining, plan_credits, rollover, topup), people_company_searches (limit, used, remaining), and members (total, owners, admins, editors). """ data = _get("/workspace") return json.dumps(data, indent=2)