Skip to main content
Glama

save_auto_topup

Create or replace the auto top-up rule for (user, credit type): whenever a deduct leaves the balance below threshold, cred buys one pack of pricing_tier_id on the user's saved card (at most max_per_day charges per 24h). If enabled and the balance is already below threshold, a charge starts right away. Saving also clears a rule cred disabled after failures. Requires a saved card to charge (a warning is returned if none); the tier must not be recurring-only. 404 USER_NOT_FOUND if the user does not exist. Costs 1 CRD (platform credit) per call, charged even when the call is then rejected (a 429 RATE_LIMITED costs nothing). Error results include request_id; quote it to support.

Input Schema

NameRequiredDescriptionDefault
api_keyNoCred API key (optional if set via the x-api-key header)
enabledNoDefault true
user_idYesExternal user ID of the card holder
thresholdYesTop up when the balance falls below this
project_idNoCred project ID (optional; the API key already identifies the project)
max_per_dayNoCharge cap per rolling 24h (default 5)
x402_paymentNoBase64 x402 PaymentPayload, only when a previous call failed with an x402 PaymentRequired because the account is out of CRD
credit_type_idNoCredit type to watch. Required when the tier allows several types (400 CREDIT_TYPE_REQUIRED otherwise)
pricing_tier_idYesOne-time (or both) pricing tier to buy

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?

With no annotations, the description carries the full burden and does so well: it discloses the 1 CRD cost charged even on rejection, that a 429 costs nothing, that saving clears a failure-disabled rule, that a warning is returned when no card exists, the 404 USER_NOT_FOUND case, and that error results include a request_id to quote to support. These are exactly the side effects and failure modes an agent needs before calling a mutation.

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?

Dense but front-loaded: the upsert action and its trigger condition come first, followed by constraints, cost, and error handling. A few clauses are compressed to the point of ambiguity (e.g. 'clears a rule cred disabled after failures'), which slightly hurts readability without wasting words.

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 9-parameter mutation with no annotations and no output schema, the description covers cost, immediate side effects, preconditions, warnings, error codes, and remediation (request_id, x402 fallback context). Nothing an agent needs to invoke it safely is missing.

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%, so the baseline is 3, but the description adds behavior-linked meaning: max_per_day is framed as an at-most charge cap per 24h, threshold as the deduct-triggered floor, and pricing_tier_id as one pack that must not be recurring-only. credit_type_id is only obliquely covered via '(user, credit type)', so it is not a full 5.

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?

States a specific verb+resource with scope: 'Create or replace the auto top-up rule for (user, credit type)'. The upsert semantics are explicit, which cleanly separates it from get_auto_topup and delete_auto_topup in the sibling list.

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?

Gives concrete prerequisites for use (saved card required, tier must not be recurring-only) and describes the immediate-charge behavior when enabled with a balance already below threshold. It does not explicitly route to siblings (e.g. get_auto_topup to inspect first, delete_auto_topup to remove), so it falls short of full alternative guidance.

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