Skip to main content
Glama

Get spending budget

get_budget
Read-only

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. remainingCents is only a ceiling, not money in a wallet: budget.spendable, on a deployment that reports it, is an upper bound on what can be spent NOW, one entry per chain the Router pays the budget token on (network, a chain id, and networkName, the name the Router gives that chain; a quote may name the same chain eip155:<id> instead, so match a quote to an entry by network) whose spendableCents is the lowest of the remaining budget, what the wallet this budget pays from holds on that chain and, for an organization wallet, what its group budget has left. A call settles on the chain the merchant quotes, so only the figure for that chain applies to it, and a balance on one chain says nothing about another: when the human asks what can be spent, answer with budget.spendable, not remainingCents, as the most that can be spent. It does not subtract payments still settling or fees not yet collected. spendableCents: null means the figure for that chain could not be determined (its balance or, for an organization wallet, its group budget could not be read), not zero; spendable: null means no figure could be determined at all (for example, the wallet behind the budget could not be resolved). A card budget has one entry with network: null, equal to remainingCents. 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, not_delivered, 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. not_delivered is held for calls the merchant answered with an error: not a confirmed charge; the reserve stays held until reconciliation decides whether the merchant charged after confirmed cancellation or authorization expiry (an older deployment reports it inside pending). 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. sessionChannels, when present, is the history behind that: each payment channel this budget used, newest first, with the merchant, its status, what was deposited (deposit, or depositAtomic in raw units when symbol is null), what came back (refund, null until the channel has closed and the refund is confirmed) and openedAt/closedAt. It is what explains money leaving the wallet and coming back when no payment shows it: a payment record carries one call's price, never the deposit. sharedWithOtherBudgets means the wallet's channel also served another budget, so its figures are not this budget's alone, and depositConfirmed: false means the open is not confirmed, so the deposit may not have landed. sessionChannelsTruncated: true means the list holds only the newest channels and older ones exist; message then says so. An empty list means none was used; null means it could not be read, and message then says so. Absent means this reader cannot see them: a budget owned by someone else, or an older deployment. Inventory fields creditsCoverage and creditsCoverageMessage describe public catalog eligibility, even when this caller has no subscription access or credit consent. Relay the message when present; absent means unavailable, never zero. A get_service endpoint carries subscription when credits can pay it. Its estimatedCreditsPerCall is an estimate from the last price seen, since credits follow the service’s live price; quote_service gives the exact credits of a request. usageBased: true beside it means the service charges by usage: the figure estimates the most a call can spend, a call spends the maximum the service names for it, and the credits the service does not take come back once its payment settles (all of them if it never does); say "up to" when you tell the human the cost. When you have a Nevermined Subscription the result also carries subscription (creditsLeft, a digit string of every unexpired credit; resetsAt, when the allowance expires and, unless cancelAtPeriodEnd, the next period's is granted; status, suspended and plan) and subscriptionMessage to relay as it stands; subscription.subscribed: false means none. Whether or not you subscribe, it also carries credits (null: could not be read, which is not the same as none): total, spendable (what can pay a call now), parts (kind allowance | welcome | topup | sla, credits, expiresAt — null never expires — and frozen: null, renewal_overdue for allowance credits frozen until a renewal payment goes through, dispute for every credit while a card dispute holds them) and nextExpiry, with creditsMessage to relay as it stands. Every amount is a digit string. Never count credits yourself. On a deployment that reports it, the result also carries creditDailyBudget beside subscription: the human's own limit on their personal credits spent per UTC day, in the fields credit_daily_limit_exceeded carries: dailyLimitCredits (a number, where 0 stops credit spending; null means no limit is set, which is unlimited, not 0), usedCredits and remainingCredits (digit strings; remainingCredits is null exactly when no limit is set) and resetsAt (the next midnight UTC), with creditDailyBudgetMessage to relay as it stands. creditDailyBudget: null means it could not be read, which is not the same as no limit; absent beside subscription means this deployment does not report it. Beside it, on a deployment that reports them, creditMonthlyBudget is the same for the UTC calendar month (monthlyLimitCredits, usedCredits, remainingCredits, resetsAt: the first midnight UTC of next month) with creditMonthlyBudgetMessage, and connectionCreditDailyBudget is this OAuth connection's own daily limit, in the daily shape, with connectionCreditDailyBudgetMessage, present only when you call through an OAuth connection. Each is null when it could not be read. When you act in an organization, the result also carries organizationCreditDailyBudget and organizationCreditMonthlyBudget (the limits an admin set on the organization's pool, refused as org_credit_daily_limit_exceeded and org_credit_monthly_limit_exceeded) and memberCreditDailyBudget (your own daily limit on the pool, member_credit_limit_exceeded), in the same shapes, each with its message, and organizationCreditBudgetOrgId: those govern calls paid from the organization's pool, which the personal limits never do. On a deployment that reports them, creditPerCallLimit is the most credits one call paid with your personal credits may cost (a number, 0 stops every paid call, null means no limit, unless creditPerCallLimitMessage says the limits could not be read; refused as credit_per_call_limit_exceeded) with creditPerCallLimitMessage, and organizationCreditPerCallLimit the same for the organization's pool (org_credit_per_call_limit_exceeded) with organizationCreditPerCallLimitMessage. Likewise creditAllowedServices lists the only services your personal credits and your own delegations may pay (null means any service, unless creditAllowedServicesMessage says the limits could not be read; [] means none; each entry is serviceId, slug, available and endpoints, null for the whole service, else the method and path of each allowed endpoint; refused as service_not_allowed) with creditAllowedServicesMessage, and organizationCreditAllowedServices the same for the organization's pool and its organization wallet (org_service_not_allowed) with organizationCreditAllowedServicesMessage. Requires your Nevermined API key on the Authorization header.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_budget"
  }
}

Input 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. Changed1 schema field changed
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: it is free to read, requires a Nevermined API key on Authorization, explains the no_active_delegation result for exhausted or expired budgets, and repeatedly instructs the agent to relay messages rather than recompute figures. This is consistent with readOnlyHint=true and adds auth/result semantics the annotations do not cover.

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

Conciseness2/5

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

It is front-loaded with purpose and usage, but then becomes a very long single-block exposition of output fields, edge cases, and message-relay instructions. Much of the content is relevant, especially without an output schema, but the lack of structure and sheer length make it hard to scan and more verbose than necessary.

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?

For a one-parameter tool with no output schema, the description covers purpose, invocation, auth, and an extensive set of return-field semantics and edge cases. It leaves little doubt about what the agent will receive or how to interpret it.

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%, so the schema already defines delegationId and its default. The description adds useful semantics beyond it: omitted means the default budget pay_service would use, and that only includes budgets that can still pay, so an earlier delegationId is needed to inspect an exhausted or expired one.

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?

Opens with a specific verb ('Read') and resource ('spending budget pay_service spends from'), then enumerates cap, spent, remaining, payment count, and expiry. It also distinguishes the budget resource from payment records and wallet balances later, so an agent can identify it without opening the 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?

Explicitly says to use it when the human asks how much is left and before a run of paid calls, and explains the no-delegationId fallback. It does not provide a clean when-not/alternatives statement for sibling tools such as wallet_balance or list_payments, though it references them while explaining fields.

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