Skip to main content
Glama

billing_topup

Charge the card on file to add credits after the user chooses a pack; returns payment confirmation or a checkout link if no card is saved.

Instructions

Top up credits by charging the account's card on file (Stripe off-session). Prefers the headless path — no checkout link required. IMPORTANT: Only call this tool after the USER has explicitly chosen a specific pack — it triggers a real charge. To show the user their options first, call billing_list_packs and present the results; do NOT pick a pack on the user's behalf. The response is ONE OF two shapes: (1) Headless success (default when a card is on file): { status: 'paid', paymentIntentId, amountUsd, credits, balance, packSku, cardLast4/receiptUrl when available }. When you receive status === 'paid', the payment has already completed and the credits are in the wallet NOW. Announce to the user: payment ID, last-4 card digits, credits added, and new balance. You are DONE — do NOT call billing_wallet to poll. (2) Checkout fallback (only when there is no card on file): { checkoutUrl, sessionId, amountUsd, credits, packSku }. When you receive checkoutUrl, hand that link to the user so they can complete payment in their browser. Valid skus: agent_4 ($4 / 160 credits), agent_5 ($5 / 220 credits), agent_25 ($25 / 1200 credits), agent_50 ($50 / 2600 credits).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packSkuYesCredit pack SKU to purchase. One of: agent_4, agent_5, agent_25, agent_50.
Behavior5/5

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

With no annotations, the description carries the full transparency burden. It discloses the financial side effect ('triggers a real charge'), the two response shapes (headless success vs. checkout fallback), and the follow-up actions (announce payment details, do NOT call billing_wallet to poll). This gives an agent a complete picture of side effects and state transitions.

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 long but well-structured: it front-loads purpose, then presents an IMPORTANT warning, then details both response shapes and the appropriate actions. Each clause serves a functional purpose, though the SKU list is repeated from the schema (with added pricing).

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 the absence of an output schema, the description fully enumerates the two possible response formats and exactly how the agent should behave for each (announce payment ID and done vs. hand over checkoutUrl). It also names sibling tools (billing_list_packs, billing_wallet) to position this tool in the workflow, making it contextually complete.

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?

The input schema already covers packSku with an enum and description (100% coverage), so the baseline is 3. The description adds value by mapping each SKU to a price and credit amount (e.g., 'agent_4 ($4 / 160 credits)') and by tying pack selection to explicit user consent, which enriches the parameter's 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 a clear verb+resource: 'Top up credits by charging the account's card on file (Stripe off-session)'. It also distinguishes itself from sibling tools by mentioning the headless path and referencing billing_list_packs and billing_wallet, making the tool's function and scope unambiguous.

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 explicitly states 'Only call this tool after the USER has explicitly chosen a specific pack — it triggers a real charge.' It also provides alternatives: 'To show the user their options first, call billing_list_packs and present the results; do NOT pick a pack on the user's behalf.' This is exemplary when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bitsandtea/postking-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server