Skip to main content
Glama

kapruka_create_order

Idempotent

Create a guest-checkout order on Kapruka and return a click-to-pay link.

Builds a Kapruka order from the supplied cart + recipient + delivery + sender,
then returns a checkout URL the customer opens in a browser to complete payment.
No Kapruka account is required. Prices are locked for the lifetime of the link
(60 minutes) — the customer pays exactly the quoted grand total even if the
catalog price changes meanwhile.

Free public tier limits: 30 orders per hour per client IP. Cart up to 30 items,
quantity up to 99 per item. A fresh idempotency key is generated per call so
retries on transient errors return the same checkout URL rather than duplicates.

Args:
    params (CreateOrderInput):
        - cart (list[CartItem]): 1–30 items. Each: product_id, quantity (default 1), optional icing_text (cakes only).
        - recipient (Recipient): name + phone (E.164 +9477… or local 077…)
        - delivery (Delivery): address, city (must be Kapruka-deliverable — use kapruka_list_delivery_cities), location_type (house/apartment/office/other, default house), date (YYYY-MM-DD, today-or-future Asia/Colombo), optional instructions
        - sender (Sender): name + anonymous flag
        - gift_message (Optional[str]): Up to 300 chars
        - currency (str): LKR (default), USD, GBP, AUD, CAD, EUR
        - response_format (str): 'markdown' (default) or 'json'

Returns:
    str: Order confirmation with checkout URL.

    JSON schema:
    {
      "checkout_url": str,           # Open in browser to pay (no login required)
      "order_ref": str,              # e.g. "ORD-20260520-7823"
      "summary": {
        "items_total":   number,
        "delivery_fee":  number,
        "addons_total":  number,
        "grand_total":   number,     # items_total + delivery_fee + addons_total
        "currency":      str
      },
      "expires_at": str              # ISO 8601 — link stops working after this
    }

    Error: "Error (<code>): <message>" on failure. Common codes:
      empty_cart, missing_field, past_delivery_date, product_not_found,
      product_out_of_stock, city_not_deliverable, date_not_deliverable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

TDQS

A5/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, idempotentHint=true), the description reveals vital behaviors: prices locked for 60 minutes, free tier limits (30 orders/hour/IP), cart and quantity limits, idempotency key generation for retries, and guest checkout without an account. It also documents error message format and common error codes. There is no contradiction with annotations.

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 well-organized into sections (summary, limits, args, returns, errors). Every sentence provides actionable information, with the core purpose front-loaded and supporting details logically grouped. No redundant or filler content.

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?

This is a complex tool with nested parameters and multiple constraints, yet the description covers all essential aspects: input structure, validation rules, error handling, return JSON schema, and behavioral semantics like pricing and idempotency. It is fully self-contained and leaves no critical gaps for an AI agent to invoke the 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 Args section paraphrases and enriches each schema field with practical meaning, such as phone format (E.164 +9477… or local 077…), icing_text only for cakes, and city must be Kapruka-deliverable. It also clarifies the response_format options and supported currencies, going well beyond the raw schema descriptions.

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 description opens with 'Create a guest-checkout order on Kapruka and return a click-to-pay link,' clearly stating the verb, resource, and outcome. It distinguishes itself from sibling tools by focusing on order creation rather than listing, searching, or tracking, leaving no ambiguity about its function.

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?

The description explicitly explains when to use the tool and how to prepare inputs, including a cross-reference to kapruka_list_delivery_cities for valid city names. It also states constraints like 'No Kapruka account is required' and delivery date must be today or future, providing clear context for correct usage. While it doesn't list exclusions for sibling tools, its role is unambiguous.

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.

TDQS

A4.7/5.0
Disambiguation5/5

Each tool targets a clearly distinct operation: delivery checking vs city listing, product search vs product fetch, order creation vs tracking, plus an auxiliary card renderer. Even the two delivery-related tools have non-overlapping purposes, and descriptions reinforce the boundary.

Naming Consistency5/5

All tools follow a consistent `kapruka_<verb>_<noun>` snake_case pattern (e.g., check_delivery, create_order, search_products). The verb-noun structure is uniform, making it easy to predict tool names.

Tool Count5/5

8 tools is well-scoped for an e-commerce MCP server, covering catalog browsing, delivery feasibility, order placement, and order tracking without unnecessary bloat. Each tool serves a distinct step in the shopping workflow.

Completeness5/5

The tool surface covers the full agent-visible lifecycle: discover products (search/get/categories), check delivery, create a guest order, and track post-payment status. There are no obvious dead ends for common shopping scenarios.