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.

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": {
      "user_id": "<user_id>",
      "pricing_tier_id": "<pricing_tier_id>",
      "threshold": "<threshold>"
    },
    "name": "save_auto_topup"
  }
}

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. Signed in with 1Profile and owning several projects, it picks one)
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. Changed1 schema field changed
    • changedInput schema / properties / project_id / description
      Previous value: -"Cred project ID (optional; the API key already identifies the project)"New value: +"Cred project ID (optional; the API key already identifies the project. Signed in with 1Profile and owning several projects, it picks one)"
  2. 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 thoroughly: it states the 1 CRD cost per call, that the charge applies even on rejection, that a 429 costs nothing, the 404 USER_NOT_FOUND case, the saved-card requirement with warning, the non-recurring tier constraint, and the request_id for support escalation. This is exactly the mutation-cost and failure-mode context an agent needs before spending money.

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?

Front-loaded with the core action, then prerequisites, then cost and error handling in a logical order, and nearly every clause carries information. It is a single dense block with heavy parentheticals, which costs some readability.

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, money-spending mutation with no annotations and no output schema, the description covers cost, preconditions, side effects, and error taxonomy. An agent can decide whether to call it and what the consequences are without further information.

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 3 is the baseline, but the description adds real semantics: threshold is evaluated after a deduct, pricing_tier_id must not be recurring-only, and credit_type_id becomes mandatory when the tier allows several types. These constraints on parameter values go beyond the schema's field descriptions.

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?

Opens with a specific verb and resource: "Create or replace the auto top-up rule for (user, credit type)". The create-or-replace scoping to a (user, credit type) pair clearly distinguishes it from get_auto_topup and delete_auto_topup, which act on the same rule.

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?

Explains the operational condition that triggers the rule (a deduct leaving balance below threshold) and that a charge starts immediately when enabled and already below threshold, plus that saving clears a cred-disabled rule. It never explicitly names get_auto_topup or delete_auto_topup as alternatives, so routing guidance is implied rather than stated.

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