Skip to main content
Glama

Get a key's budget

get_key_budget
Read-onlyIdempotent

Get a key's budget

One key's budget (any working model key of the account, a customer's included: the keys the list_budgets tool lists), each limit with its spend this window. Its monthly limit is the key's monthlyLimitUsd, so a key created with a monthly cap has a budget (hard_stop, no alert). 404 not_found for an unknown or revoked key, or a key without a budget. Windows are UTC: the day from midnight, the week from Monday, the month from the 1st, lifetime from when that limit was set.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

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

Input Schema

NameRequiredDescriptionDefault
idYesThe key id: any working model key of the account, a customer's included (GET /budgets lists them).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), yet the description still adds real behavioral detail: 404 not_found for unknown/revoked keys or keys without a budget, and the exact UTC window semantics for day/week/month/lifetime. It also explains that a monthly cap yields a hard_stop budget with no alert, which is non-obvious domain behavior.

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?

The opening line merely repeats the title, and the parenthetical 'a customer's included: the keys the `list_budgets` tool lists' is dense and awkwardly punctuated, slowing comprehension. The window semantics at the end are valuable but should be broken into a cleaner list rather than folded into a run-on sentence.

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?

Despite having no output schema, the description conveys what comes back (limits with spend per window), the error case, and the window boundaries an agent needs to interpret spend values correctly. Nothing material for correct invocation or interpretation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With one parameter at 100% schema coverage, the schema already documents the id fully. The description restates the same constraint (any working model key, customer keys included, see list_budgets) without adding format or edge-case detail beyond the schema text, so the baseline 3 applies.

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?

States a specific verb and resource ('Get a key's budget') and immediately scopes the result: each limit with its spend this window, plus how a monthly limit maps to monthlyLimitUsd. It also names list_budgets as the enumerating sibling, so an agent can distinguish the single-key read from the listing tool.

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?

The description clarifies which keys are valid (any working model key of the account, customer keys included) and points to list_budgets for discovering ids. It does not spell out an explicit 'do not use this for account-level budgets' exclusion, but the account-budget siblings make that inference cheap.

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