credit_balance
Check remaining credits for AI detection and plagiarism scans to verify availability before batch content analysis operations.
Instructions
Check your Originality.ai credit balance. Returns remaining credits available for scanning. Use before batch operations to verify you have enough credits.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The main handler function that executes the credit_balance tool logic. It calls the client's get_credit_balance() method, extracts the balance from the result, and returns it as formatted TextContent.
async def handle_credit_balance( arguments: dict[str, Any], client: OriginalityClient, ) -> list[TextContent]: """Check credit balance.""" result = await client.get_credit_balance() balance = result.get("credits", result.get("balance", "unknown")) return [TextContent(type="text", text=f"**Originality.ai Credit Balance:** {balance}")] - Tool definition with name 'credit_balance', description explaining its purpose, and inputSchema showing it requires no input parameters (empty object with no properties).
Tool( name="credit_balance", description=( "Check your Originality.ai credit balance. Returns remaining credits " "available for scanning. Use before batch operations to verify you have " "enough credits." ), inputSchema={ "type": "object", "properties": {}, "required": [], }, ), - armavita_originality_ai_mcp/server.py:61-61 (registration)Registration mapping where the tool name 'credit_balance' is mapped to its handler function handle_credit_balance in the HANDLERS dictionary.
"credit_balance": handle_credit_balance, - Client helper method that makes the actual HTTP GET request to the Originality.ai v1 API endpoint /account/credits/balance and returns the JSON response.
async def get_credit_balance(self) -> dict[str, Any]: """Get remaining account credits (v1 endpoint).""" resp = await self.client_v1.get("/account/credits/balance") resp.raise_for_status() return resp.json()