Skip to main content
Glama

get_account_status

Check remaining credits and budget limits for Dune Analytics queries to manage usage and prevent overspending.

Instructions

Check remaining credits and budget limits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_account_status' MCP tool. Decorated with @mcp.tool(), it retrieves Dune account usage via dune_service.get_usage(), parses billing periods, syncs with budget manager, and returns formatted status string with credits used, limit, remaining, and period.
    @mcp.tool() def get_account_status() -> str: """ Check remaining credits and budget limits. """ try: usage = dune_service.get_usage() # Parse usage object if hasattr(usage, 'billing_periods') and usage.billing_periods: current = usage.billing_periods[0] limit = current.credits_included used = current.credits_used remaining = limit - used # Sync with BudgetManager budget_manager.sync_usage(float(used), float(limit)) return ( f"Dune Account Status:\n" f"- Credits Used: {int(used)}\n" f"- Credits Limit: {int(limit)}\n" f"- Remaining: {int(remaining)}\n" f"- Period: {current.start_date} to {current.end_date}" ) return f"Dune Account Status: {usage}" except Exception as e: return f"Could not fetch account status: {str(e)}"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nice-bills/dune-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server