Skip to main content
Glama

get_credits

Check your available credits for generating videos and images with Luma AI's Dream Machine.

Instructions

Gets credit information for the current user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the get_credits tool by calling the Luma API /credits endpoint and formatting the credit balance.
    async def get_credits(parameters: dict) -> str: """Get the credit information for the current user.""" try: result = await _make_luma_request("GET", "/credits") if not isinstance(result, dict): raise ValueError("Invalid response from API") return f"Credit Information:\nAvailable Credits: {result.get('credit_balance', 0)}" except Exception as e: logger.error(f"Error in get_credits: {str(e)}", exc_info=True) return f"Error retrieving credit information: {str(e)}"
  • Pydantic input schema for the get_credits tool (no parameters required).
    class GetCreditsInput(BaseModel): pass
  • Registration of the get_credits tool in the list_tools() function.
    Tool( name=LumaTools.GET_CREDITS, description="Gets credit information for the current user", inputSchema=GetCreditsInput.model_json_schema(), ),
  • Dispatch case for get_credits in the call_tool() function.
    case LumaTools.GET_CREDITS: result = await get_credits(arguments) return [TextContent(type="text", text=result)]
  • Tool name constant in LumaTools enum.
    GET_CREDITS = "get_credits"

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/bobtista/luma-ai-mcp-server'

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