Skip to main content
Glama

Get credit balance

get_credits
Read-onlyIdempotent

Current credit balance, and optionally the recent ledger. Every ledger entry carries apiKeyId/apiKeyName so you can see exactly what THIS key spent. Check the balance before proposing any paid generation. When the balance will not cover what the user wants, say what IS affordable rather than only that they are short — "1200 for all three animations, you have 900, so two now or top up for all three" is the useful answer. API-key calls can use the account's full wallet balance; the dashboard-only 600-credit experiment and its activation exception do not apply. freeCreditLimit therefore reports applies:false with exemptionReason:"api_key". Two remaining walls need OPPOSITE advice: running out of BALANCE is fixed by buying credits (the 402 carries a topUpUrl — send that link, never quote prices, they change), while hitting the key's DAILY SPEND CAP is not a money problem at all — the credits are already in the account, and the fixes are raising the cap or waiting for resetsAt. Never suggest a purchase for a cap trip. If the user asks HOW to raise the cap: the 403 carries capSettingsUrl — give them that link and tell them to edit the key there. YOU cannot change it, by design: the cap edit needs a logged-in session and is unreachable with an API key, because a key that could raise its own cap would not be a cap. Do not retry hoping it passes, and do not ask them to paste credentials.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax items to return (default 100, max 500).
apiKeyIdNoFilter ledger entries to one key (UUID).
includeLedgerNoAlso return recent ledger entries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already mark it read-only, open-world, idempotent, and non-destructive, so the description adds substantial behavioral context beyond those hints: the 402 response carries topUpUrl, the 403 carries capSettingsUrl, freeCreditLimit reports applies:false with exemptionReason:'api_key', and the cap cannot be edited via API. This is valuable non-obvious behavior an agent needs to act correctly.

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

Conciseness4/5

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

The description is front-loaded with the core purpose and is dense rather than padded. It is long, but nearly every sentence contributes decision-relevant guidance about balance vs. cap, error responses, and user communication. It could be trimmed slightly without losing value, but it remains well organized.

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 read-only billing tool with no output schema, the description is unusually complete: it covers response semantics, error-code behavior, the freeCreditLimit exception, and the exact decision path for insufficient balance versus daily cap. An agent has enough information to call the tool and interpret the result correctly.

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?

Schema description coverage is 100%, so the baseline is 3; the schema already documents limit, apiKeyId, and includeLedger. The description adds some context by explaining that ledger entries carry apiKeyId/apiKeyName, which deepens the meaning of filtering, but it does not materially compensate for or add to the individual parameter semantics.

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 opens with 'Current credit balance, and optionally the recent ledger,' which identifies the exact resource and the two modes of the call. It also clarifies that ledger entries carry apiKeyId/apiKeyName, making the tool's specific value distinct from generic getters like get_subscription_allowances.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description is explicit about when to call it: 'Check the balance before proposing any paid generation.' It also gives conditional guidance depending on the result, including what to say when the balance is short, and distinguishes a balance shortfall from a daily spend cap trip. No alternative tool is needed because the description fully covers when this read is appropriate.

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