Skip to main content
Glama

Polyglot Publishing

Create a payment link

create_checkout_link

Open a Stripe checkout session for one edition and return its payment link. Give that link to the buyer: they enter their card on Stripe's own page, and the ebook is emailed to them once the payment clears. The link expires after 24 hours, and nothing is charged until the buyer pays. For a paperback, no direct link is returned — print orders need a shipping address, so the buyer is sent to the product page instead. The returned price is always in euros (currency is EUR); if another currency was requested, Stripe converts it on its payment page and the amount charged there differs from price — checkout_currency names that currency, so do not announce price in it. Pass the item_id returned by list_editions whenever you have one.

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": "create_checkout_link"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatNoDefaults to ebook. Used only when item_id is not given.
editionNoDefaults to bilingual. Used only when item_id is not given.
item_idNoEdition identifier returned by list_editions. Preferred. Never build one yourself.
book_uidNoUsed only when item_id is not given.
currencyNoISO 4217 code the buyer is charged in, e.g. EUR, USD, GBP, JPY. Defaults to EUR.
buyer_countryNoThe buyer's country as an ISO 3166-1 alpha-2 code, e.g. US, GB, JP. Pass it when known: it sets the tax and any current discount, so the buyer pays the same price as on the website. Pass the same buyer_country to both calls. In India the paperback price includes delivery.
known_languageNoLanguage already known. Used only when item_id is not given.
third_languageNoRequired for a trilingual edition. Used only when item_id is not given.
learning_languageNoLanguage being learned. Used only when item_id is not given.
interface_languageNoLanguage of the Stripe payment page, of the product page and of the emails sent to the buyer. Defaults to the language the reader already knows.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / buyer_country / description
      Previous value: -"The buyer's country as an ISO 3166-1 alpha-2 code, e.g. US, GB, JP. Pass it when known: it sets the tax and any current discount, so the buyer pays the same price as on the website."New value: +"The buyer's country as an ISO 3166-1 alpha-2 code, e.g. US, GB, JP. Pass it when known: it sets the tax and any current discount, so the buyer pays the same price as on the website. Pass the same buyer_country to both calls. In India the paperback price includes delivery."
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare a non-readonly, non-idempotent, open-world call, and the description adds real behavior: the link expires after 24 hours, nothing is charged until the buyer pays, and paperback orders bypass the link entirely. It also warns that the charged amount can differ from the returned EUR price when another currency is requested — a caveat an agent could not infer from the schema alone. It does not say whether repeated calls spawn duplicate sessions, which matters given idempotentHint=false.

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 action and the returned artifact, then progressively adds caveats. Sentences are dense but each carries distinct information; the currency paragraph is the densest and could be split, but nothing is padding.

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?

With ten optional parameters, no required fields, no output schema, and complex precedence among identifier modes, the description does the essential work of steering to item_id and explaining the paperback no-link case. It also names return-side concepts (link, price, checkout_currency) in lieu of an output schema. Remaining gap: no guidance on the return shape when no link is produced or on duplicate-session behavior.

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 the baseline is 3; the description earns above that by establishing precedence (item_id preferred over book_uid/edition/format/language params) and by adding an output-side warning that checkout_currency should not be used to announce the price. The tax/discount effect of buyer_country is already in the schema, so that portion is not new value.

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?

States a specific verb and resource — "Open a Stripe checkout session for one edition and return its payment link" — and immediately splits the outcome by format (ebook link vs. paperback redirect). An agent can distinguish this from list_editions or get_book without opening the schema.

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?

Gives concrete selection advice: "Pass the item_id returned by list_editions whenever you have one" and "For a paperback, no direct link is returned" so the agent knows the product-page path applies instead. It stops short of explicitly excluding sibling tools (e.g., don't use this to look up edition metadata), so it is clear context rather than full when/when-not routing.

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