Skip to main content
Glama

Aitole — Kaspi Pay

Create recurring invoice (subscription)

create_subscription

Create a recurring invoice: Kaspi has no auto-debit, so Aitole sends an invoice to the customer's phone on a schedule and the customer pays it in Kaspi in one tap. Amounts are whole tenge (KZT) as integers: 5000 means 5,000 tenge, no tiyn/decimals. Each invoice is a normal operation with subscription_id; it counts as paid only with status "paid". By default the first invoice is sent one period from now; use bill_immediately or first_billing_at to change it. Pass idempotency_key (e.g. "sub-client-77") so a retry does not create a second subscription. Use for repeating charges to the same phone (memberships, courses, rent); for a single charge use create_invoice. Returns the subscription with id, status and next_billing_at; pass that id to get_subscription, list_subscription_invoices, pause_subscription or cancel_subscription.

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": {
      "phone": "<phone>",
      "amount": "<amount>",
      "period": "<period>"
    },
    "name": "create_subscription"
  }
}

Input Schema

NameRequiredDescriptionDefault
phoneYesCustomer phone in E.164 format, e.g. +77001234567. Must be a Kaspi client.
amountYesAmount of each invoice. Integer, whole tenge (KZT).
periodYesBilling period.
metadataNoOptional JSON object stored with the record and returned back (e.g. {"order_id": "1024"}).
on_unpaidNoAfter all retries fail: "expire" ends the subscription after a grace period, "continue" moves to the next period.
billing_dayNoDay of the period to bill: 1-7 for week (day of week), 1-28 for month/quarter.
descriptionNoInvoice description; "{today}" is replaced by the billing date, e.g. "Course, {today}".
billing_timeNoTime "HH:MM" in Almaty time, 06:00-22:00 (default 13:00).
total_cyclesNoTotal number of payments; omit for no end.
connection_idNoOptional Kaspi connection (cash register) id. Only needed when the account has several connections.
idempotency_keyNoOptional. Your own unique id for this request, e.g. the order number "order-1024". Repeating a call with the same idempotency_key returns the same result instead of creating a duplicate, so pass one whenever you might retry. If omitted, a random key is generated (then a retry WILL create a duplicate).
subscriber_nameNoOptional customer name for your records.
bill_immediatelyNoSend the first invoice right away.
first_billing_atNoDate YYYY-MM-DD of the first invoice (not together with bill_immediately).
grace_period_daysNoGrace period in days (default 3).
max_retry_attemptsNoRetries of an unpaid invoice (default 3).
billing_day_from_endNoFor month/quarter instead of billing_day: days from the end of the month (0 = last day).
retry_interval_hoursNoHours between retries (default 24).
external_subscriber_idNoOptional id of the customer in your system.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the coarse safety profile (not read-only, open-world, not inherently idempotent); the description adds the substantive behavior an agent actually needs: Kaspi has no auto-debit, each invoice is a normal operation tied to subscription_id, an invoice counts as paid only with status "paid", and retries without an idempotency_key WILL create duplicates — consistent with idempotentHint=false. It also documents the default first-billing timing and how bill_immediately/first_billing_at override it.

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 what the tool actually does and why (no auto-debit), then units, then defaults, then the alternative tool. Slightly dense at ~8 sentences for one definition, and the "one tap in Kaspi" detail is color rather than decision-relevant, but almost every clause is load-bearing.

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 19-parameter creation tool with no output schema, the description still covers return shape ("Returns the subscription with id, status and next_billing_at"), default scheduling behavior, idempotency safety, and the sibling boundary. Nothing an agent needs to invoke this correctly 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 description coverage is 100%, so the baseline is 3; the description still adds value by disambiguating the two timing controls ("By default the first invoice is sent one period from now; use bill_immediately or first_billing_at to change it") and by spelling out the consequence of omitting idempotency_key with a concrete example. Amount units are restated rather than newly explained, so it stops short of a 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?

"Create a recurring invoice" states a specific verb and resource, and the description immediately explains the mechanism (scheduled invoice to the customer's phone, paid in one tap) plus the sibling it is not: "for a single charge use create_invoice". An agent can distinguish it from create_invoice and create_payment_link without opening any schema.

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?

Explicit routing: "Use for repeating charges to the same phone (memberships, courses, rent); for a single charge use create_invoice." It also names the downstream tools that consume the returned id (get_subscription, list_subscription_invoices, pause_subscription, cancel_subscription), so the follow-on path is clear.

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.