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"
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'gets' information, implying a read-only operation, but doesn't clarify aspects like authentication needs, rate limits, error conditions, or what 'credit information' entails (e.g., balance, history). This leaves significant gaps for a tool with no structured safety hints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that directly states the tool's function without any wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema) and lack of annotations, the description is minimal. It doesn't explain what 'credit information' includes (e.g., format, units) or behavioral traits like response structure, which could be helpful for an agent to interpret results effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so there's no need for parameter details in the description. The description correctly avoids redundant parameter information, earning a high baseline score for this dimension.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('gets') and resource ('credit information for the current user'), making the tool's purpose understandable. However, it doesn't differentiate from sibling tools like 'get_generation' or 'list_generations' in terms of what specific data it retrieves, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context (e.g., after certain actions), or exclusions, leaving the agent with minimal usage cues beyond the tool name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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