Skip to main content
Glama

get_budget_status

Check current budget status and spending limits for Bitcoin Lightning Network payments. View available funds and configured thresholds to manage autonomous transaction capabilities.

Instructions

View current budget status and spending limits (read-only). Edit ~/.lightning-enable/config.json to change limits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `get_budget_status` function implements the tool's core logic by querying the budget service and returning its status as a JSON string.
    async def get_budget_status(
        budget_service: "BudgetService | None" = None,
    ) -> str:
        """
        View current budget status and spending limits (read-only).
    
        Returns the complete budget configuration, session state, and BTC price info.
        Configuration is READ-ONLY - edit ~/.lightning-enable/config.json to change limits.
    
        Args:
            budget_service: BudgetService instance for budget tracking
    
        Returns:
            JSON with complete budget status including:
            - configuration: All config settings (tiers, limits, session)
            - session: Current session state (spent, remaining, request count)
            - price: Current BTC/USD price info
            - note: Reminder that config is read-only
        """
        if not budget_service:
            # Try to get the global singleton
            try:
                from ..budget_service import get_budget_service
                budget_service = get_budget_service()
            except Exception as e:
                return json.dumps({
                    "success": False,
                    "error": f"Budget service not initialized: {e}",
                    "hint": "Budget service is initialized on first use. Try making a payment first."
                })
    
        try:
            status = budget_service.get_status()
            return json.dumps({
                "success": True,
                **status,
            }, indent=2)
        except Exception as e:
            logger.exception("Error getting budget status")
            return json.dumps({
                "success": False,
                "error": sanitize_error(str(e))
            })
  • The `get_budget_status` tool is registered in the MCP server's list of available tools.
        name="get_budget_status",
        description=(
            "View current budget status and spending limits (read-only). "
            "Edit ~/.lightning-enable/config.json to change limits."
        ),
        inputSchema={
            "type": "object",
            "properties": {},
        },
    ),
  • The `get_budget_status` tool handler is routed in the server's main tool invocation logic.
    elif name == "get_budget_status":
        result = await get_budget_status(
            budget_service=self.budget_service,
        )
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 the tool is 'read-only', which is a key behavioral trait for safety. However, it doesn't mention other aspects like rate limits, authentication needs, error conditions, or what 'budget status' entails (e.g., timeframes, currency). The config file mention is extraneous to tool behavior.

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

Conciseness4/5

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

The description is concise with two sentences, but the second sentence about editing a config file is not directly relevant to tool usage and could be considered wasteful. The first sentence efficiently states the purpose and read-only nature. Overall, it's well-structured but includes minor extraneous information.

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 the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and safety (read-only), but lacks details on what 'budget status' includes (e.g., values, format) or behavioral context like response structure. For a tool with no structured data, it should provide more completeness about outputs or usage context.

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 with 100% schema description coverage, so the schema fully documents the lack of inputs. The description adds no parameter information, which is appropriate here. Baseline is 4 for 0 parameters, as no compensation is needed.

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: 'View current budget status and spending limits' with the specific verb 'view' and resource 'budget status and spending limits'. It distinguishes from siblings like 'configure_budget' (which edits) by specifying 'read-only', but doesn't explicitly differentiate from other read tools like 'get_all_balances' or 'check_wallet_balance' beyond the resource focus.

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 minimal guidance: it states the tool is 'read-only' and mentions editing a config file to change limits, but this is not a usage guideline for the tool itself. It lacks explicit when-to-use instructions, prerequisites, or alternatives among siblings (e.g., vs. 'get_all_balances' or 'configure_budget'), leaving the agent to infer based on purpose alone.

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/refined-element/lightning-enable-mcp'

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