Skip to main content
Glama

get_credits

Retrieve credit information for the current user to manage usage and access to the Luma Dream Machine’s video and image creation features.

Instructions

Gets credit information for the current user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main asynchronous handler function for the 'get_credits' tool. It calls the Luma API's /credits endpoint using the shared _make_luma_request helper and formats the credit balance response.
    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 model defining the input schema for the get_credits tool. It has no required parameters.
    class GetCreditsInput(BaseModel): pass
  • Tool registration in the list_tools() function, specifying the name, description, and input schema.
    Tool( name=LumaTools.GET_CREDITS, description="Gets credit information for the current user", inputSchema=GetCreditsInput.model_json_schema(), ),
  • Dispatch logic in the call_tool() function that routes calls to the get_credits handler.
    case LumaTools.GET_CREDITS: result = await get_credits(arguments) return [TextContent(type="text", text=result)]
  • Enum constant defining the tool name string within LumaTools.
    GET_CREDITS = "get_credits"

Other Tools

Related Tools

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