Skip to main content
Glama

TgPay Crypto Merchant API

createInvoice

Create a one-off payment invoice; the payer opens result.mini_app_invoice_url. See the invoices doc.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "createInvoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
fiatNoFiat code (fiat mode).
assetNoAsset code (crypto mode).
amountNoDecimal string in MAJOR units, e.g. "5" = 5 USDT. Never a float. Required unless open_amount is true.
payloadNoOpaque data echoed back in the webhook (≤4096).
swap_toNoAuto-convert the received amount to this asset.
customerNo
cancel_urlNoA «Return» link shown while the invoice is unpaid.
expires_inNoInvoice TTL in seconds.
descriptionNoShown to the payer (≤1024).
open_amountNoCrypto mode only: the payer chooses the amount (donation) — pass true and NO amount.
success_urlNoShort form of the paid button: a «Return» button to this link after the payment (not together with paid_btn_*).
webhook_urlNoThis operation's own https webhook address — its updates go there instead of the app's `webhook_url`.
max_paymentsNoMulti-payment invoice (2..1000000): the link takes this many payments, each one its own invoice with `parent_invoice_id`; wallet payments only.
paid_btn_urlNoURL for the paid button.
currency_typeNocrypto (default) | fiat.
paid_btn_nameNoviewItem | openChannel | openBot | callback.
allow_commentsNoDefault true.
hidden_messageNoRevealed to the payer ONLY after payment (≤2048).
accepted_assetsNoFiat mode: comma-separated assets the payer may pay in.
allow_anonymousNoDefault true.
client_invoice_idNoYour own id of the invoice (≤64, unique per app): a create that repeats it returns the existing invoice; `getInvoices {client_invoice_id}` finds it.
rate_lock_secondsNoFiat mode: freeze crypto quotes for this long.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / amount / description
      Previous value: -"Decimal string in MAJOR units, e.g. \"5\" = 5 USDT. Never a float. Omit for an open-amount invoice."New value: +"Decimal string in MAJOR units, e.g. \"5\" = 5 USDT. Never a float. Required unless open_amount is true."
    • addedInput schema / properties / open_amount
      Added value: +{
      +  "description": "Crypto mode only: the payer chooses the amount (donation) — pass true and NO amount.",
      +  "type": "boolean"
      +}
  2. Changed6 schema fields changed
    • addedInput schema / properties / cancel_url
      Added value: +{
      +  "description": "A «Return» link shown while the invoice is unpaid.",
      +  "type": "string"
      +}
    • addedInput schema / properties / client_invoice_id
      Added value: +{
      +  "description": "Your own id of the invoice (≤64, unique per app): a create that repeats it returns the existing invoice; `getInvoices {client_invoice_id}` finds it.",
      +  "type": "string"
      +}
    • addedInput schema / properties / customer
      Added value: +{
      +  "properties": {
      +    "email": {
      +      "description": "The buyer's email.",
      +      "type": "string"
      +    },
      +    "id": {
      +      "description": "The buyer's id in your system.",
      +      "type": "string"
      +    },
      +    "telegram_id": {
      +      "description": "The buyer's Telegram id.",
      +      "type": "string"
      +    },
      +    "telegram_username": {
      +      "description": "Without @.",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / max_payments
      Added value: +{
      +  "description": "Multi-payment invoice (2..1000000): the link takes this many payments, each one its own invoice with `parent_invoice_id`; wallet payments only.",
      +  "type": "integer"
      +}
    • addedInput schema / properties / success_url
      Added value: +{
      +  "description": "Short form of the paid button: a «Return» button to this link after the payment (not together with paid_btn_*).",
      +  "type": "string"
      +}
    • addedInput schema / properties / webhook_url
      Added value: +{
      +  "description": "This operation's own https webhook address — its updates go there instead of the app's `webhook_url`.",
      +  "type": "string"
      +}
  3. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare a non-read, non-destructive write, so safety is covered. The description adds one genuinely useful behavioral fact — that the payer-facing link is result.mini_app_invoice_url — which matters because there is no output schema. It does not mention idempotency via client_invoice_id or the fiat/crypto mode split, leaving that to the schema.

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?

Two tight clauses with no padding, and the payer-facing link is front-loaded alongside the purpose. The trailing "See the invoices doc" is a dangling pointer with no URL or identifier, which is the only waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 22-parameter mutation tool with no output schema, the description supplies the single most decision-relevant return value and leaves the well-covered schema to handle the rest. The unresolved doc reference and absence of any auth or idempotency note are minor gaps against such rich structured data.

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 description coverage is 95% and the 22 parameters are documented in detail in the schema itself, including mode-specific constraints and defaults. The description adds no parameter-level meaning beyond what the schema already states, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Create a one-off payment invoice") and the word "one-off" implicitly separates it from the recurring createSubscriptionPlan sibling. It also names the key output field the payer will use. It stops short of explicitly naming an alternative, so it is clear but not fully differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"One-off" implies this is for single payments rather than recurring plans, which is usable implicit guidance given the sibling set. There are no explicit when/when-not conditions, no prerequisites, and no routing to getInvoices or createSubscriptionPlan for other cases.

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