Skip to main content
Glama

llmkit_budget_status

Read-onlyIdempotent

Check budget limits and remaining balance to monitor AI spending across providers. Track costs and usage stats for budget management.

Instructions

Check budget limits and remaining balance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budgetIdNoSpecific budget ID, or omit for all

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
budgetsYes

Implementation Reference

  • The handler function for the `llmkit_budget_status` tool.
    export async function handleBudgetStatus(args: Record<string, unknown> | undefined) {
      const budgetId = args?.budgetId as string | undefined;
      const budgetData = await getBudgets();
      if (!budgetData.budgets.length) return ok('No budgets configured.', { budgets: [] });
    
      const filtered = budgetId ? budgetData.budgets.filter(b => b.id === budgetId) : budgetData.budgets;
      if (!filtered.length) return fail(`Budget ${budgetId} not found.`);
    
      const budgets = filtered.map(b => ({ id: b.id, name: b.name, limitUsd: cents(b.limit_cents), period: b.period }));
    
      return ok([
        'Budget Status',
        '\u2500'.repeat(25),
        ...budgets.map(b => `${b.name}: $${b.limitUsd.toFixed(2)} limit - ${b.period}`),
      ].join('\n'), { budgets });
    }
  • Definition and input schema for the `llmkit_budget_status` tool.
    name: 'llmkit_budget_status',
    description: 'Check budget limits and remaining balance',
    inputSchema: {
      type: 'object' as const,
      properties: {
        budgetId: { type: 'string', description: 'Specific budget ID, or omit for all' },
      },
    },
  • Registration mapping in HANDLER_MAP that associates `llmkit_budget_status` with `handleBudgetStatus`.
    llmkit_budget_status: handleBudgetStatus,

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/smigolsmigol/llmkit-mcp-server'

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