Skip to main content
Glama

purchase_credits

Buy a one-time credit top-up, charging a card on file or falling back to checkout.

Charges the default payment method on file when one exists and returns the new balance. Otherwise returns a secure hosted checkout link so the purchase can complete interactively. Errors clearly when self-service billing is not enabled on this deployment, or when the requested amount falls outside the allowed range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amount_usdYesAmount of credits to buy, in whole US dollars.
idempotency_keyNoOptional caller-supplied key that makes a retried purchase request safe to resend without buying credits twice.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations indicate readOnlyHint false (mutation), idempotentHint false, destructiveHint false. The description adds context: charges default payment method or returns checkout link, and returns new balance. It also notes error conditions. The description aligns with annotations and provides useful behavioral details.

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

Conciseness5/5

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

The description is succinct, using 4-5 sentences with no unnecessary fluff. It effectively front-loads the core action and then details the two possible scenarios and error conditions.

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?

Given the tool has an output schema, the description explains the two possible outcomes (balance or checkout link) and errors. This covers the essential context for an agent to invoke the tool 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 has 2 parameters, both with descriptions (schema coverage 100%). The description does not add new information about parameters beyond what the schema provides, so baseline score of 3 is appropriate.

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 clearly states it buys a one-time credit top-up, distinguishing it from sibling tools like configure_auto_top_up or cancel_subscription. The verb 'buy' and resource 'credit top-up' are specific and unambiguous.

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 explains when to use (one-time purchase) and describes two paths: charging card on file or falling back to checkout link. It also mentions error conditions (self-service billing disabled, amount out of range). However, it does not explicitly state when not to use or suggest alternatives like configure_auto_top_up for recurring purchases.

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.