Skip to main content
Glama

sell_book

Create a checkout link for a book order with an itemized price breakdown, calculating total from price, quantity, delivery fee, and discount. Returns a payment URL to send the buyer.

Instructions

Create a checkout link for a book order, with the price breakdown filled in.

Builds the line items (copies, discount, delivery), computes the total as
price * quantity + delivery_fee - discount, generates a unique reference ID from
the title, and creates the payment link. Returns the checkout `url` to send the
buyer. The total must reach Wayl's 1000 IQD minimum or the call is rejected.

The buyer sees an itemised breakdown rather than a bare number, which is what you
want for anything beyond a single flat-priced copy.

Creating the link charges nobody — it only produces a checkout page, and a link
created with env='test' never moves real money at all. Do NOT deliver the book
(send a download link, ship a copy) until `check_order_paid` or `parse_webhook` returns
`safeToFulfil: true`. That is a different field from `paid`: a sandbox payment
settles and is still not something to ship against.

Use `create_payment_link` instead when you need a webhook, redirect or custom
line items for one order: here those URLs come from the server's
WAYL_WEBHOOK_URL, WAYL_WEBHOOK_SECRET and WAYL_REDIRECT_URL settings and cannot
be set per call. Persist the returned `code` — no other endpoint returns it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envNo'live' takes real money, 'test' is a sandbox that charges nobody. Defaults to 'test'.
priceYesPrice of one copy in whole IQD — no decimal subunits. The order total after delivery and discount must still reach 1000 IQD.
titleYesBook title, used as the checkout line-item label. Long titles are truncated to Wayl's 255-character label limit; very short ones are padded to its 3-character minimum.
discountNoDiscount to subtract from the whole order, in whole IQD — not per copy.
quantityNoHow many copies.
delivery_feeNoDelivery or handling charge in IQD. Use 0 for ebooks.
reference_idNoYour order ID, unique across all your links. Generated from the title if omitted.
customer_noteNoFree-form note stored on the order as `customParameter` and echoed back on reads, for your own tracking. May be visible at checkout, so keep secrets out of it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description discloses side effects: creating the link 'charges nobody', env='test' 'never moves real money at all', and it stresses the safeToFulfil requirement. This goes well beyond the annotations (readOnlyHint=false, destructiveHint=false) by explaining the real-world impact and the distinction between paid and safeToFulfil.

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?

The description is long but tightly packed: every sentence adds a distinct piece of information (purpose, calculation, minimum, env behavior, fulfillment warning, alternative tool, persistence hint). It's structured with clear paragraphs and 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?

With an output schema already present, the description still covers the key returned fields (`url`, `code`), the rejection condition (total below 1000 IQD), and the critical fulfillment check (`safeToFulfil`). Together with the rich annotations and schema, an agent has everything it needs to invoke this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already documents all 8 parameters at 100%, but the description adds the exact formula (`price * quantity + delivery_fee - discount`), the 1000 IQD minimum, and title truncation/padding details. It also clarifies that discount applies to the whole order, not per copy.

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 opening sentence names the exact action and output: 'Create a checkout link for a book order, with the price breakdown filled in.' It goes on to specify the mechanics (line items, total computation, reference ID) and explicitly contrasts with create_payment_link, so the purpose is unmistakable.

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?

It tells the agent exactly when to prefer this tool: 'Use `create_payment_link` instead when you need a webhook, redirect or custom line items for one order.' It also gives the negative condition ('for anything beyond a single flat-priced copy') and warns about fulfillment timing, which is crucial usage context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/muthanii/waylMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server