Skip to main content
Glama
grammy-mcp
by louietyj

createInvoiceLink

Creates a Telegram invoice payment link from product details, prices, and a provider token so bots can collect payments and return a checkout link.

Instructions

Use this method to create a link for an invoice. Returns the created invoice link as String on success.

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": {
      "title": "<title>",
      "description": "<description>",
      "payload": "<payload>",
      "provider_token": "<provider_token>",
      "currency": "<currency>",
      "prices": "<prices>"
    },
    "name": "createInvoiceLink"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleYesProduct name, 1-32 characters
pricesYesPrice breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
payloadYesBot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
currencyYesThree-letter ISO 4217 currency code, see more on currencies
need_nameNoPass True if you require the user's full name to complete the order
photo_urlNoURL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
need_emailNoPass True if you require the user's email address to complete the order
photo_sizeNoPhoto size in bytes
descriptionYesProduct description, 1-255 characters
is_flexibleNoPass True if the final price depends on the shipping method
photo_widthNoPhoto width
photo_heightNoPhoto height
provider_dataNoData about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
max_tip_amountNoThe maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
provider_tokenYesPayment provider token, obtained via BotFather
need_phone_numberNoPass True if you require the user's phone number to complete the order
subscription_periodNoThe number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified.
need_shipping_addressNoPass True if you require the user's shipping address to complete the order
suggested_tip_amountsNoAn Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
business_connection_idNoUnique identifier of the business connection on behalf of which the link will be created
send_email_to_providerNoPass True if the user's email address should be sent to the provider
send_phone_number_to_providerNoPass True if the user's phone number should be sent to the provider

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, openWorldHint=true and destructiveHint=false, so the safety profile is covered. The description adds only that a String link is returned on success; it says nothing about payment-provider dependencies, whether the link is reusable or single-use, or what happens on failure. Useful but thin beyond what the annotations supply.

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 short sentences, front-loaded with the action and followed by the return value; nothing is redundant. It is efficient but so terse that it borders on under-specification rather than exemplary conciseness.

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

Completeness2/5

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

This is a 22-parameter, 6-required payment tool with an open-world hint and no output schema. Given that complexity, the description should at minimum explain what the resulting link is for, how it relates to sendInvoice, and any provider-token prerequisites; it supplies none of that.

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 100% across all 22 parameters, including units, currency exponent rules, byte limits and the subscription_period constraint, so the schema carries the parameter burden. The description adds no parameter meaning at all, which lands at the baseline for fully documented schemas.

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?

The description states a specific verb and resource: 'create a link for an invoice', and it even names the success return type ('Returns the created invoice link as String'). It is clear on its own, though it does not distinguish itself from the invoice-adjacent sibling sendInvoice, so an agent must infer the difference.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no prerequisites, and no mention of alternatives such as sendInvoice (which delivers an invoice into a chat) versus this tool (which produces a shareable link). The agent must decide on its own when a link is preferable to sending the invoice directly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools