get_credit_balance
Get the current Metadata AI credit balance for the account this token belongs to.
Read account
Returns data. Calling it changes nothing, so it is safe in an unattended loop.
What it does
Get the current Metadata AI credit balance for the account this token belongs to.
USAGE INSTRUCTIONS FOR LLM:
Tool calls against this server consume AI credits. When the balance reaches zero
or goes negative, every other tool on this server starts refusing with an
OUT OF CREDITS error that carries a payment link. This tool is how you check
the balance before that happens, and how you confirm a top-up has landed.
WHEN TO USE THIS TOOL:
- Another tool just failed with OUT OF CREDITS — check here before retrying
- The account owner says they have paid, and you need to know if it landed yet
- The user asks "how many credits do I have?" or "what's my AI balance?"
- Before starting a long batch of tool calls, to confirm there is headroom
IMPORTANT — AFTER A TOP-UP, POLL, DO NOT SPIN:
Payment settles ASYNCHRONOUSLY. A card can be charged successfully and the
balance still read as exhausted for a minute or two while the payment clears.
Poll this tool every 20-30 seconds, not continuously. Resume the work you were
doing only once `is_exhausted` is false.
EXPECTED RESPONSE FORMAT:
{
"account_id": "1234",
"balance_usd": 42.5, // may be NEGATIVE — that is a real state
"updated_at": "2026-08-07T12:00:00",
"is_exhausted": false // true means other tools will refuse
}
On failure returns {"error": "..."} — treat an unreadable balance as unknown,
not as zero, and do not tell the user they are out of credits because of it.Arguments
Takes no arguments.
Request
curl
curl -s -X POST https://mcp-server.metadata.io/mcp \
-H "Authorization: $METADATA_PAT" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-11-25" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_credit_balance","arguments":{}}}'
Response
Real, from the production server, in 527 ms. Values that identify a customer or disclose money are replaced with typed placeholders; keys, types and nesting are exactly as returned.
recorded response
{
"account_id": "[account_id redacted]",
"balance_usd": "[number redacted]",
"updated_at": "2026-09-05T14:49:30.945036",
"is_exhausted": false
}
Related
Other account tools: