Skip to main content
Glama

Get spending budget

get_budget

Read the spending budget pay_service spends from: its cap, what has been spent, what remains, how many payments were made (and the limit, if any), and when it expires. Reading costs nothing and charges nothing. Use it whenever the human asks how much is left, or before a run of paid calls. Money is in CENTS: capCents is whole cents; spentCents and remainingCents can carry up to four decimals because the budget is charged per call at 1/10,000 of a cent (e.g. "1.632" = 1.632¢), and spentCents + remainingCents = capCents while the budget is within its cap. Tell the human message as it stands and never substitute a figure of your own: the budget includes routing fees and rounding, so adding up your calls will not match it. With no delegationId it reads the budget pay_service would use; that only includes budgets that can still pay, so {"status":"no_active_delegation"} also covers a budget that ran out or expired — pass the delegationId from an earlier pay_service result to read that one anyway. On a deployment that reports it, spentByDeliveryStatusCents splits the spend by what each payment delivered (delivered, charged_not_delivered, charged_unconfirmed, not_charged, pending, the deliveryStatus values list_payments uses), and unattributedSpentCents is spend no payment record itemizes; a non-zero charged_not_delivered is what was spent on calls that delivered nothing although the merchant charged (the merchant charge plus any routing fee not given back), so tell the human. lockedInChannels, when present, is money the wallet this budget pays from has deposited into payment channels with merchants that charge per call (per token, as in wallet_balance). It is that WALLET's total, shared by every budget paying from it, not a figure of this budget's own: it is NOT spent and NOT charged to this budget, it can pay further calls only to the merchant holding each channel, and what is unused comes back to that wallet when the channel closes, after 15 minutes without use; message then says so. An empty list means nothing is locked; null means it could not be read, and message then says that too. When you have a Nevermined Subscription the result also carries subscription (creditsLeft, a digit string of credits spendable now; resetsAt, when they expire and, unless cancelAtPeriodEnd, the next period's are granted; status, suspended and plan) and subscriptionMessage to relay as it stands; subscription.subscribed: false means none. Never count credits yourself. Requires your Nevermined API key on the Authorization header.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
delegationIdNoA specific delegation to read (every paid pay_service result carries one). Omit it to read the budget pay_service spends by default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it states reading is free and charges nothing (safety profile), requires an API key on the Authorization header (auth), explains the no_active_delegation status and that it can also mean a depleted/expired budget, and clarifies that lockedInChannels belongs to the wallet, is not spent, and returns after 15 minutes. It also explains the rounding/routing-fee caveat and instructs the agent to relay 'message' verbatim rather than recompute figures.

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

Conciseness3/5

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

Purpose and usage are front-loaded, which is good, but the body is a dense multi-clause wall of text packing output-field semantics, subscription rules, and channel mechanics into single sentences. Given there is no output schema much of the detail is justified, yet the size and nesting of clauses make it harder to scan than it needs to be.

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

Completeness5/5

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

There is no output schema, so the description must explain return values, and it covers the budget fields, delivery-status breakdown, unattributed spend, lockedInChannels states (empty/null), and the subscription block including the subscribed:false case. An agent has everything needed to call and interpret the result.

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?

Schema coverage is 100% with a single optional parameter, so the baseline is 3, but the description adds genuine meaning beyond the schema: it tells the agent where a delegationId comes from ('every paid pay_service result carries one') and what omitting it excludes. This is more than the schema's restated default.

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

Purpose5/5

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

The description names a specific verb and resource ('Read the spending budget pay_service spends from') and enumerates exactly what is returned: cap, spent, remaining, payment count and limit, expiry. It is clearly distinct from siblings like wallet_balance, list_payments, and payment_summary, which the agent can rule out without opening any schema.

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?

It gives explicit triggers: 'Use it whenever the human asks how much is left, or before a run of paid calls.' It also explains the delegationId omission case and its side effect (only budgets that can still pay are included), routing the agent on behavior rather than naming an alternative tool outright. No explicit 'prefer X over Y' statement keeps it short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources