Skip to main content
Glama

Buy Fermi credits with your saved card

buy_credits
Destructive

Charges the user's saved payment card to buy Fermi credits, or, if no card is saved yet, returns a checkout link instead and charges nothing. Use this when the user asks to buy or top up Fermi credits, including before the dollar amount is named and while the user is not signed in. Never call it on your own initiative.

The user's authorization: before the call, tell the user the number of credits and the dollar charge (credits times $0.50; for example 10 credits is $5.00). The user's yes to that, or a request that already names both the credits and the dollar amount, authorizes that one call: make it then, without asking again, and make it again after a sign-in. It does not authorize a second purchase. A request that names only the credits ("buy 10 credits") is still a request for this tool: state the dollar charge, and make the call on the user's yes. A call refused because the user is not signed in charges nothing, so the call made again after the sign-in is still that one purchase.

Returns credits_purchased, new_balance and payment_status after a charge. With no saved card, the first call charges nothing: it returns a checkout_url where the user saves a card in a browser, so that call needs no separate warning about a charge. Then call this again.

One call can buy at most 100 credits; a larger request is refused and nothing is charged.

Credits pay for estimates on an account (see estimate_quantity_or_probability for tier costs). To see the balance first, use check_account_and_credits. When the user is not signed in, call the tool as normal. If the user's app supports sign-in, it will ask the user to sign in, and you can call the tool again after that. Do not send the user to their connector or app settings to sign in first. Only if the user's app cannot sign in (a REST caller, or an agent with no connector), create an account with POST https://fermi.kromatic.com/api/v1/accounts (it returns an api_key once; a new account starts with 3 credits) and pass that key as the api_key argument.

Cost: real money -- charges the saved card $0.50 per credit. Needs an account.

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": {
      "credits": "<credits>"
    },
    "name": "buy_credits"
  }
}

Input Schema

NameRequiredDescriptionDefault
api_keyNoYour Fermi API key. Omit it if your connector is signed in with permission to buy credits.
creditsYesHow many credits to buy, 1 to 100. Each is charged to the saved card at the price in this tool's cost line.

Output Schema

NameRequiredDescriptionDefault
billingNoWho this call was billed to and what is left. Present on every Fermi result.
new_balanceNoCredit balance after it.
checkout_urlNoNo card saved: open this in a browser to save one, then call buy_credits again.
credits_addedNo0 when a checkout_url is returned instead.
payment_statusNoCard payment status.
credits_purchasedNoCredits bought by this call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / credits / description
      Previous value: -"How many credits to buy, at least 1. Each is charged at the price in this tool's cost line."New value: +"How many credits to buy, 1 to 100. Each is charged to the saved card at the price in this tool's cost line."
    • addedInput schema / properties / credits / maximum
      Added value: +100
  2. Changed5 schema fields changed
    • addedInput schema / properties / api_key / description
      Added value: +"Your Fermi API key. Omit it if your connector is signed in with permission to buy credits."
    • addedInput schema / properties / credits / description
      Added value: +"How many credits to buy, at least 1. Each is charged at the price in this tool's cost line."
    • addedOutput schema / description
      Added value: +"Either a completed purchase (credits_purchased, new_balance, payment_status) or, with no saved card, a checkout_url and credits_added 0."
    • addedOutput schema / properties
      Added value: +{
      +  "billing": {
      +    "additionalProperties": true,
      +    "description": "Who this call was billed to and what is left. Present on every Fermi result.",
      +    "properties": {
      +      "account_id": {
      +        "description": "Account id; null without an account.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "account_status": {
      +        "description": "\"created\" if this call created the account, otherwise \"matched\"; null without an account.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "anonymous_estimates_remaining_today": {
      +        "description": "Free tier-1 estimates left today without an account; null for an account.",
      +        "type": [
      +          "integer",
      +          "null"
      +        ]
      +      },
      +      "anonymous_quota_resets_at": {
      +        "description": "When the free allowance resets (next 00:00 UTC, ISO 8601).",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "auth_source": {
      +        "description": "How you were recognised: \"bearer\" (signed-in connector or token), \"api_key\" (the argument) or \"anonymous\".",
      +        "enum": [
      +          "bearer",
      +          "api_key",
      +          "anonymous"
      +        ],
      +        "type": "string"
      +      },
      +      "charged_to": {
      +        "description": "What this call drew on: the free daily allowance, account credits, or \"none\" (free calls).",
      +        "enum": [
      +          "anonymous_quota",
      +          "credits",
      +          "none"
      +        ],
      +        "type": "string"
      +      },
      +      "credit_balance": {
      +        "description": "Credits left on the account; null without an account.",
      +        "type": [
      +          "integer",
      +          "null"
      +        ]
      +      },
      +      "credits_charged": {
      +        "description": "Credits this call spent.",
      +        "type": "integer"
      +      },
      +      "is_unlimited": {
      +        "description": "True for an internal account that is never charged.",
      +        "type": "boolean"
      +      },
      +      "principal": {
      +        "description": "\"anonymous\" (no account) or \"account\".",
      +        "enum": [
      +          "anonymous",
      +          "account"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "checkout_url": {
      +    "description": "No card saved: open this in a browser to save one, then call buy_credits again.",
      +    "type": "string"
      +  },
      +  "credits_added": {
      +    "description": "0 when a checkout_url is returned instead.",
      +    "type": "integer"
      +  },
      +  "credits_purchased": {
      +    "description": "Credits bought by this call.",
      +    "type": "integer"
      +  },
      +  "new_balance": {
      +    "description": "Credit balance after it.",
      +    "type": "integer"
      +  },
      +  "payment_status": {
      +    "description": "Card payment status.",
      +    "type": "string"
      +  }
      +}
    • changedOutput schema / title
      Previous value: -"buy_creditsDictOutput"New value: +"BuyCreditsResult"
  3. Changed4 schema fields changed
    • addedInput schema / properties / api_key / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / api_key / default
      Added value: +null
    • removedInput schema / properties / api_key / type
      Removed value: -"string"
    • changedInput schema / required
      Previous value: -[
      -  "credits",
      -  "api_key"
      -]New value: +[
      +  "credits"
      +]
  4. Changed1 schema field changed
    • changedOutput schema / additionalProperties
      Previous value: -{
      -  "anyOf": [
      -    {
      -      "type": "integer"
      -    },
      -    {
      -      "type": "string"
      -    }
      -  ]
      -}New value: +true
  5. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare destructive=true, readOnlyHint=false and non-idempotency, but the description adds substantial context the agent cannot get elsewhere: $0.50 per credit, a hard 100-credit ceiling with refusal and no charge, the no-card checkout_url path that charges nothing, and the fact that a sign-in refusal is free. What it does not spell out is whether a successful charge is refundable or how a double-call is guarded, which keeps it below a 5.

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 definition is front-loaded with the core action and the strongest constraint ('Never call it on your own initiative') before the procedural detail, and it is broken into short paragraphs that are easy to scan. It loses a point for redundancy: the $0.50 rate appears twice, 'charges nothing' is restated three times, and the sign-in retry logic is explained across three separate passages.

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 money-moving tool this covers everything an agent needs: cost, per-call ceiling, authorization protocol, the no-card branch, the unauthenticated path including the API-key fallback, and which fields come back. An output schema exists, so the description need not detail return values, yet it names them anyway, making it self-sufficient.

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% (both parameters documented), so the baseline is 3; the description earns above that by giving the pricing semantics of 'credits' ($0.50 each, example 10 credits = $5.00) and by explaining how api_key should be obtained when the connector cannot sign in. It still repeats the schema's maximum of 100 rather than adding to it.

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 opening sentence names a specific verb and resource ('Charges the user's saved payment card to buy Fermi credits') and immediately distinguishes the no-card branch ('returns a checkout link instead and charges nothing'). It also routes to siblings by name (check_account_and_credits, estimate_quantity_or_probability), so an agent can separate this from read-only balance tools 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 Guidelines5/5

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

Explicitly states when to use it ('when the user asks to buy or top up Fermi credits, including before the dollar amount is named and while the user is not signed in'), when not to ('Never call it on your own initiative'), and what the authorization trigger is. It also names the alternative for inspecting balance first. This is about as complete a usage contract as a description can carry.

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