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
| Name | Required | Description | Default |
|---|---|---|---|
| budgetId | No | Specific budget ID, or omit for all |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budgets | Yes |
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' }, }, }, - packages/mcp-server/src/tools.ts:295-295 (registration)Registration mapping in HANDLER_MAP that associates `llmkit_budget_status` with `handleBudgetStatus`.
llmkit_budget_status: handleBudgetStatus,