Skip to main content
Glama

get_budget_status

Check spending limits and remaining budget for Lightning Wallet agents to monitor and control autonomous payment usage.

Instructions

Get budget status for an agent - shows limit, spent, and remaining. Works with operator or agent keys.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idNoAgent ID (operators only, omit for current agent)

Implementation Reference

  • The getBudgetStatus method in the LightningFaucetClient class fetches budget status from the API.
     */
    async getBudgetStatus(agentId?: number): Promise<{
      agentId: number;
      budgetLimitSats: number | null;
      totalSpentSats: number;
      remainingSats: number | null;
      hasBudget: boolean;
      rawResponse: ApiResponse;
    }> {
      const data: Record<string, unknown> = {};
      if (agentId) data.agent_id = agentId;
    
      const result = await this.request<ApiResponse & {
        agent_id?: number;
        budget_limit_sats?: number | null;
        total_spent?: number;
        total_spent_sats?: number;
        remaining_sats?: number | null;
        has_budget?: boolean;
      }>('get_budget_status', data);
    
      const budgetLimit = result.budget_limit_sats ?? null;
      const totalSpent = result.total_spent_sats || result.total_spent || 0;
    
      return {
        agentId: result.agent_id || agentId || 0,
        budgetLimitSats: budgetLimit,
        totalSpentSats: totalSpent,
        remainingSats: budgetLimit !== null ? budgetLimit - totalSpent : null,
        hasBudget: budgetLimit !== null,
        rawResponse: result,
      };
    }
  • MCP tool handler implementation for get_budget_status.
    case 'get_budget_status': {
      const parsed = GetBudgetStatusSchema.parse(args);
      const result = await session.requireClient().getBudgetStatus(parsed.agent_id);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              agent_id: result.agentId,
              budget_limit_sats: result.budgetLimitSats,
              total_spent_sats: result.totalSpentSats,
              remaining_sats: result.remainingSats,
              has_budget: result.hasBudget,
            }, null, 2),
          },
        ],
      };
    }
  • Input schema for get_budget_status tool.
    const GetBudgetStatusSchema = z.object({
      agent_id: z.number().int().positive().optional().describe('Agent ID (operators only, defaults to current agent)'),
    });
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses authentication behavior ('Works with operator or agent keys') and output details ('shows limit, spent, and remaining'), which are useful. However, it lacks information on rate limits, error conditions, or whether this is a read-only operation (though 'Get' implies it). The description adds some value but doesn't fully cover behavioral traits for a tool with no annotations.

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 concise and front-loaded: two sentences that efficiently convey purpose and usage. Every sentence earns its place by providing essential information without redundancy or fluff.

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

Completeness3/5

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

Given no annotations, no output schema, and a simple input schema with one parameter, the description is moderately complete. It covers purpose and authentication but lacks details on output format, error handling, or specific behavioral constraints. For a tool with no structured data beyond the input schema, it should do more to compensate, making it adequate but with gaps.

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

Parameters3/5

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

The input schema has 100% description coverage, with the parameter 'agent_id' documented as 'Agent ID (operators only, omit for current agent).' The description doesn't add any parameter semantics beyond this, as it only mentions 'agent' generically. With high schema coverage, the baseline is 3, and the description doesn't compensate with extra details.

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 tool's purpose: 'Get budget status for an agent - shows limit, spent, and remaining.' It specifies the verb ('Get') and resource ('budget status') with concrete output details. However, it doesn't explicitly differentiate from sibling tools like 'check_balance' or 'get_transactions', which might also involve financial queries.

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

Usage Guidelines4/5

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

The description provides clear context for usage: 'Works with operator or agent keys.' This indicates authentication requirements. However, it doesn't specify when to use this tool versus alternatives like 'check_balance' or 'get_transactions', nor does it mention prerequisites or exclusions beyond the implied key types.

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/lightningfaucet/lightning-wallet-mcp'

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