Skip to main content
Glama

addCredits

Add credits to a customer's credit balance at no charge, as an administrator allocation. Returns the created credits transaction. Credits must be turned on for the location; pass the customer's location as transaction.locationRef. Omit transaction.expirationDate for credits that never expire; otherwise pass an ISO datetime within the expiration day in the location's timezoneId, and the credits expire at the end of that day. Each call creates a new transaction: when a call fails or times out, list the customer's transactions before calling again, so the same amount is not applied twice. Call getLocations to list locations, or getLocation to fetch one by locationId. Call getCustomers to list valid customerRef values. Never invent UUIDs; only use values from prior tool responses.

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": {
      "transaction": "<transaction>"
    },
    "name": "addCredits"
  }
}

Input Schema

NameRequiredDescriptionDefault
transactionYesCredits to add.

Output Schema

NameRequiredDescriptionDefault
transactionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / transaction / properties / endingBalance
      Added value: +{
      +  "description": "Total credits balance of the customer right after the transaction. Not returned for transactions created before the field was introduced, or for the expiration of credits that lapsed on their expiration date.",
      +  "type": "number"
      +}
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare a non-read-only but non-destructive write; the description adds the crucial traits annotations can't express: every call creates a new transaction (so it is not idempotent), a failed or timed-out call must be reconciled by listing transactions before retrying, and a location prerequisite must be satisfied.

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?

Front-loaded with purpose and cost model, then prerequisites, then the expiration rule, then the duplicate-prevention procedure. Dense but every sentence carries operational information; no filler.

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 write tool with a nested object parameter, the description covers prerequisites, idempotency risk, retry reconciliation, and reference sourcing, and the existence of an output schema means the return value ('the created credits transaction') needs no further elaboration.

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% with nested descriptions, but the description still adds semantics the schema lacks: the expirationDate rule (omit for never-expiring credits; otherwise an ISO datetime within the expiration day in the location's timezoneId, expiring at end of that day) and the constraint that locationRef be the customer's location.

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 specific verb and resource ('Add credits to a customer's credit balance') and immediately scopes it with 'at no charge, as an administrator allocation,' which separates it from deductCredits and addDayPasses without needing their schemas.

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?

It gives concrete conditions: credits must be enabled for the location, locationRef must be the customer's location, and it names getLocations/getLocation/getCustomers as the way to obtain valid references. It also prescribes a retry procedure after a failure. The only gap is it never states when to prefer a sibling such as deductCredits instead.

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