Skip to main content
Glama

Create order

create_order
Idempotent

Create an order with line items. Currency is required: use trusted source facts or CRM product prices; never guess or convert. Idempotent by externalId: re-sending the same request returns the existing order. Counts toward the plan's monthly order limit (403 PLAN_LIMIT_EXCEEDED when reached). The result echoes the operating workspace. Use search_products first. For a promo code use quote_order_promotion, then send promotion.code and promotion.expectedTotal. CRM alone calculates discounts, net totals, usage limits and free shipping. Do not invent a discount, send a legacy discountAmount, or promise free shipping from your own arithmetic.

Input Schema

NameRequiredDescriptionDefault
itemsYesOrder line items (1-100). Each snapshots productName/sku/unitPrice.
notesNoInternal note stored on the order. For a delivery instruction from the buyer use delivery.comment instead.
currencyYesRequired ISO 4217 currency code from the source facts or selected CRM product prices. Never guess or convert between currencies.
customerNoOptional buyer snapshot (name/email/phone, or a storefront customer externalId). Omit for an anonymous order.
deliveryNoHow the buyer asked to receive the order: carrier, branch/courier/pickup, branch text, recipient, cash-on-delivery and a delivery note. This is the buyer's choice at checkout — it does not dispatch anything. Record what actually ships with POST /orders/{externalId}/shipments.
promotionNoAsk the CRM to validate and calculate this promo code. Do not supply promoCode, discountAmount or shippingThresholdAmount alongside it. An optional expectedTotal refuses a changed quote; the server always owns the actual discount.
externalIdYesA stable unique id for this order in your system — the idempotency key. Re-sending the same externalId returns the existing order instead of creating a duplicate (e.g. 'mcp-<uuid>').

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • removedInput schema / properties / currency / default
      Removed value: -"UAH"
    • changedInput schema / properties / currency / description
      Previous value: -"ISO 4217 currency code for the order (uppercase, e.g. UAH). Default UAH."New value: +"Required ISO 4217 currency code from the source facts or selected CRM product prices. Never guess or convert between currencies."
    • removedInput schema / properties / discountAmount
      Removed value: -{
      -  "description": "Money taken off by the promo code, in the order currency. A sum, not a percent: a percent at order level is ambiguous (before or after line discounts, with shipping or without). Does NOT change total — send the total the buyer actually paid.",
      -  "minimum": 0,
      -  "type": "number"
      -}
    • removedInput schema / properties / promoCode
      Removed value: -{
      -  "description": "The promo code the storefront applied to this order, recorded as-is. The CRM never validates or computes it — the cart owns that — but storing it is what makes 'did that campaign pay for itself?' answerable later.",
      -  "maxLength": 64,
      -  "type": "string"
      -}
    • addedInput schema / properties / promotion
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Ask the CRM to validate and calculate this promo code. Do not supply promoCode, discountAmount or shippingThresholdAmount alongside it. An optional expectedTotal refuses a changed quote; the server always owns the actual discount.",
      +  "properties": {
      +    "code": {
      +      "description": "CRM-managed promo code, 3–64 letters, digits, hyphens or underscores; case-insensitive. Must be enabled for this connection's source; a personal or capture code also needs the buyer email it was issued to.",
      +      "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{2,63}$",
      +      "type": "string"
      +    },
      +    "expectedTotal": {
      +      "description": "Net merchandise total the buyer was shown, as a decimal string with up to two decimals (for example \"199.90\"), in the order currency. If the CRM now calculates a different amount the request is refused with price_changed.",
      +      "pattern": "^\\d{1,10}(?:\\.\\d{1,2})?$",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "externalId",
      -  "items"
      -]New value: +[
      +  "currency",
      +  "externalId",
      +  "items"
      +]
  2. Changed5 schema fields changed
    • addedInput schema / properties / delivery / properties / branchRef
      Added value: +{
      +  "description": "The carrier's own identifier for the branch or parcel locker, as returned by GET /api/v1/carriers/{carrier}/warehouses. The same value the shipment-label endpoint calls warehouseRef. Sent, this removes all guessing; omitted, the CRM falls back to matching `branch` as text.",
      +  "maxLength": 64,
      +  "type": "string"
      +}
    • addedInput schema / properties / delivery / properties / building
      Added value: +{
      +  "description": "House number for courier delivery, structured rather than inside the address line because carriers validate it on its own (Nova Poshta accepts up to 11 characters matching digits plus an optional Cyrillic letter or block, e.g. \"12Б\" or \"12/4\").",
      +  "maxLength": 35,
      +  "type": "string"
      +}
    • addedInput schema / properties / delivery / properties / cityRef
      Added value: +{
      +  "description": "The carrier's own identifier for the destination city, as returned by GET /api/v1/carriers/{carrier}/cities. Required alongside branchRef or streetRef for a waybill to be created from the order alone.",
      +  "maxLength": 64,
      +  "type": "string"
      +}
    • addedInput schema / properties / delivery / properties / flat
      Added value: +{
      +  "description": "Apartment or office number for courier delivery.",
      +  "maxLength": 35,
      +  "type": "string"
      +}
    • addedInput schema / properties / delivery / properties / streetRef
      Added value: +{
      +  "description": "The carrier's own identifier for the street, as returned by GET /api/v1/carriers/{carrier}/streets. Courier delivery only; pair it with `building`.",
      +  "maxLength": 64,
      +  "type": "string"
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / discountAmount
      Added value: +{
      +  "description": "Money taken off by the promo code, in the order currency. A sum, not a percent: a percent at order level is ambiguous (before or after line discounts, with shipping or without). Does NOT change total — send the total the buyer actually paid.",
      +  "minimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / promoCode
      Added value: +{
      +  "description": "The promo code the storefront applied to this order, recorded as-is. The CRM never validates or computes it — the cart owns that — but storing it is what makes 'did that campaign pay for itself?' answerable later.",
      +  "maxLength": 64,
      +  "type": "string"
      +}
  4. Changed1 schema field changed
    • changedInput schema / properties / customer / properties / email / pattern
      Previous value: -"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"New value: +"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
  5. Changed2 schema fields changed
    • addedInput schema / properties / delivery
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "How the buyer asked to receive the order: carrier, branch/courier/pickup, branch text, recipient, cash-on-delivery and a delivery note. This is the buyer's choice at checkout — it does not dispatch anything. Record what actually ships with POST /orders/{externalId}/shipments.",
      +  "properties": {
      +    "branch": {
      +      "description": "Branch or parcel locker as the buyer named it, e.g. \"відділення №5\" or \"поштомат 12345\". Free text: the CRM resolves it against the live branch list of the carrier when creating a waybill.",
      +      "maxLength": 200,
      +      "type": "string"
      +    },
      +    "carrier": {
      +      "description": "Carrier slug the buyer chose, from GET /capabilities (e.g. \"nova_poshta\", \"ukrposhta\", \"pickup\"). This is a preference, not a dispatch — the shipment endpoint still records what actually ships.",
      +      "maxLength": 120,
      +      "type": "string"
      +    },
      +    "cod": {
      +      "description": "True when the buyer pays on delivery (cash on delivery).",
      +      "type": "boolean"
      +    },
      +    "comment": {
      +      "description": "Delivery note from the buyer, e.g. \"дзвонити після 18:00\". Not the order notes.",
      +      "maxLength": 1000,
      +      "type": "string"
      +    },
      +    "method": {
      +      "description": "How the parcel reaches the buyer: \"branch\" (carrier office/locker), \"courier\" (to the address) or \"pickup\" (buyer collects from you).",
      +      "enum": [
      +        "branch",
      +        "courier",
      +        "pickup"
      +      ],
      +      "type": "string"
      +    },
      +    "phone": {
      +      "description": "Recipient phone, when it differs from the buyer's own contact phone.",
      +      "maxLength": 50,
      +      "type": "string"
      +    },
      +    "recipientName": {
      +      "description": "Who receives the parcel, when that is not the buyer (a gift, an office).",
      +      "maxLength": 200,
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / notes
      Added value: +{
      +  "description": "Internal note stored on the order. For a delivery instruction from the buyer use delivery.comment instead.",
      +  "maxLength": 5000,
      +  "type": "string"
      +}
  6. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  7. Changed9 schema fields changed
    • addedInput schema / properties / currency / description
      Added value: +"ISO 4217 currency code for the order (uppercase, e.g. UAH). Default UAH."
    • addedInput schema / properties / customer / description
      Added value: +"Optional buyer snapshot (name/email/phone, or a storefront customer externalId). Omit for an anonymous order."
    • addedInput schema / properties / externalId / description
      Added value: +"A stable unique id for this order in your system — the idempotency key. Re-sending the same externalId returns the existing order instead of creating a duplicate (e.g. 'mcp-<uuid>')."
    • addedInput schema / properties / items / description
      Added value: +"Order line items (1-100). Each snapshots productName/sku/unitPrice."
    • addedInput schema / properties / items / items / properties / discount / description
      Added value: +"Percentage discount on this line (0-100). Default 0."
    • addedInput schema / properties / items / items / properties / productName / description
      Added value: +"Line item name, snapshotted onto the order. Use search_products to quote a real catalog product's name. Required."
    • addedInput schema / properties / items / items / properties / quantity / description
      Added value: +"Quantity ordered (integer, at least 1)."
    • addedInput schema / properties / items / items / properties / sku / description
      Added value: +"Product SKU snapshot (from search_products). Optional."
    • addedInput schema / properties / items / items / properties / unitPrice / description
      Added value: +"Price per unit in the order currency, as a decimal (e.g. 199.99). Snapshotted onto the line."
  8. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare idempotentHint=true and readOnlyHint=false, but the description goes well beyond by explaining the idempotency mechanism (keyed on externalId, returns existing order), disclosing a quota failure mode (403 PLAN_LIMIT_EXCEEDED on plan monthly order limit), and noting the result echoes the operating workspace. These are concrete behavioral traits not derivable from the annotations.

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 core action and required currency, then flows into idempotency, limits, and guardrails. Mostly dense and purposeful, though a few clauses (currency guidance) restate schema content and add slight redundancy.

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?

For a 7-parameter nested mutation tool with no output schema, the description covers the essential context: idempotency contract, quota limits, workspace behavior, cross-tool sequencing, and calculation ownership. An agent has enough to call it correctly without inferring from structured fields.

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 description coverage is already 100%, so baseline is 3, but the description adds real semantic value: it warns against sending legacy discountAmount or promoCode alongside promotion, and explains that CRM—not the caller—owns discount/net-total/free-shipping calculation. This clarifies the promotion object's intent beyond the raw schema.

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+resource ('Create an order with line items') and clearly distinguishes itself from siblings by naming the related tools (search_products, quote_order_promotion, shipment endpoint) it interacts with. An agent immediately understands this is the order-creation entry point.

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?

Explicit sequencing is given: 'Use search_products first' and 'For a promo code use quote_order_promotion, then send promotion.code and promotion.expectedTotal.' It also states when-not to act (never guess/convert currency, don't invent discounts, don't send legacy discountAmount), which is exactly the when/when-not/alternative guidance this dimension rewards.

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