Skip to main content
Glama

create_cart

Idempotent

Create a shopping cart in Demo Store. Returns a cart_id for use with get_shipping_rates, preview_checkout, and complete_checkout.

SKYFIRE TOKEN (optional): Provide a kya or kya-pay Skyfire token in the skyfire-pay-id request header to boost your agent trust score (up to +0.35), which may unlock better pricing or priority service. No token required — request proceeds with neutral trust score (0.50) if omitted or invalid. PAYMENT MANDATE: this tool also requires one, sent as an X-Payment-Mandate header. This tool does not accept extra arguments, so the header is the only channel here. It must carry mandate_id, max_amount_cents, currency, exp, sub, aud, and its currency must match the cart's currency or the call is denied outright. The cap in max_amount_cents is enforced against the cart total. CREDENTIAL: this store needs one. Call the create_sandbox_key tool first (it is in this tool list and needs no credential), then pass the key you get back as the agent_key argument — or as an Authorization: Bearer header if your client can set headers. Do not ask a person to log in: there is no human login for this store.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesItems to add to cart
agent_tokenNoJWS compact (EdDSA/Ed25519) signed by the agent. Required for Shopify enforcement rules R001/R002/R004. The token is embedded as a server-authoritative cart attribute — Trusteed does NOT verify the signature here; that is done offline by the Shopify Function WASM.
display_contextNoAgent display capability: webview (browser) or headlessheadless
agent_session_idNoOpaque agent session identifier for cart resume across sessions

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
statusYes
cart_idYes
currencyYes
store_nameYes
session_stateYes
subtotal_centsYes
display_contextYes
agent_session_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +true
    • changedOutput schema / properties / items / items / additionalProperties
      Previous value: -falseNew value: +true
  2. Changed4 schema fields changed
    • changedInput schema / properties / items / items / properties / variant_id / description
      Previous value: -"Variant ID (optional)"New value: +"Variant ID (optional). Must match a variant id listed by get_product_details; an unknown id is rejected rather than silently replaced by the default variant."
    • addedOutput schema / properties / items / items / properties / sku
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / items / items / properties / variant_id
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / items / items / properties / variant_title
      Added value: +{
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "agent_session_id": {
      +      "type": "string"
      +    },
      +    "cart_id": {
      +      "type": "string"
      +    },
      +    "currency": {
      +      "type": "string"
      +    },
      +    "display_context": {
      +      "enum": [
      +        "webview",
      +        "headless"
      +      ],
      +      "type": "string"
      +    },
      +    "items": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "line_price": {
      +            "type": "number"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "quantity": {
      +            "type": "number"
      +          },
      +          "unit_price": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "quantity",
      +          "unit_price",
      +          "line_price"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "session_state": {
      +      "enum": [
      +        "new",
      +        "resumed"
      +      ],
      +      "type": "string"
      +    },
      +    "status": {
      +      "const": "NOT_READY_FOR_PAYMENT",
      +      "type": "string"
      +    },
      +    "store_name": {
      +      "type": "string"
      +    },
      +    "subtotal_cents": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "cart_id",
      +    "store_name",
      +    "items",
      +    "subtotal_cents",
      +    "currency",
      +    "status",
      +    "agent_session_id",
      +    "session_state",
      +    "display_context"
      +  ],
      +  "type": "object"
      +}
  4. Changed4 schema fields changed
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties
      Added value: +{
      +  "agent_session_id": {
      +    "description": "Opaque agent session identifier for cart resume across sessions",
      +    "type": "string"
      +  },
      +  "agent_token": {
      +    "description": "JWS compact (EdDSA/Ed25519) signed by the agent. Required for Shopify enforcement rules R001/R002/R004. The token is embedded as a server-authoritative cart attribute — Trusteed does NOT verify the signature here; that is done offline by the Shopify Function WASM.",
      +    "type": "string"
      +  },
      +  "display_context": {
      +    "default": "headless",
      +    "description": "Agent display capability: webview (browser) or headless",
      +    "enum": [
      +      "webview",
      +      "headless"
      +    ],
      +    "type": "string"
      +  },
      +  "items": {
      +    "description": "Items to add to cart",
      +    "items": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "product_id": {
      +          "description": "Product ID",
      +          "type": "string"
      +        },
      +        "quantity": {
      +          "default": 1,
      +          "description": "Quantity",
      +          "minimum": 1,
      +          "type": "integer"
      +        },
      +        "variant_id": {
      +          "description": "Variant ID (optional)",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "product_id"
      +      ],
      +      "type": "object"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  }
      +}
    • addedInput schema / required
      Added value: +[
      +  "items"
      +]
  5. Changed5 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties
      Removed value: -{
      -  "agent_session_id": {
      -    "description": "Opaque agent session identifier for cart resume across sessions",
      -    "type": "string"
      -  },
      -  "display_context": {
      -    "default": "headless",
      -    "description": "Agent display capability: webview (browser) or headless",
      -    "enum": [
      -      "webview",
      -      "headless"
      -    ],
      -    "type": "string"
      -  },
      -  "items": {
      -    "description": "Items to add to cart",
      -    "items": {
      -      "additionalProperties": false,
      -      "properties": {
      -        "product_id": {
      -          "description": "Product ID",
      -          "type": "string"
      -        },
      -        "quantity": {
      -          "default": 1,
      -          "description": "Quantity",
      -          "minimum": 1,
      -          "type": "integer"
      -        },
      -        "variant_id": {
      -          "description": "Variant ID (optional)",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "product_id"
      -      ],
      -      "type": "object"
      -    },
      -    "minItems": 1,
      -    "type": "array"
      -  }
      -}
    • removedInput schema / required
      Removed value: -[
      -  "items"
      -]
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": false,
      -  "properties": {
      -    "agent_session_id": {
      -      "type": "string"
      -    },
      -    "cart_id": {
      -      "type": "string"
      -    },
      -    "currency": {
      -      "type": "string"
      -    },
      -    "display_context": {
      -      "enum": [
      -        "webview",
      -        "headless"
      -      ],
      -      "type": "string"
      -    },
      -    "items": {
      -      "items": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "line_price": {
      -            "type": "number"
      -          },
      -          "name": {
      -            "type": "string"
      -          },
      -          "quantity": {
      -            "type": "number"
      -          },
      -          "unit_price": {
      -            "type": "number"
      -          }
      -        },
      -        "required": [
      -          "name",
      -          "quantity",
      -          "unit_price",
      -          "line_price"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    "session_state": {
      -      "enum": [
      -        "new",
      -        "resumed"
      -      ],
      -      "type": "string"
      -    },
      -    "status": {
      -      "const": "NOT_READY_FOR_PAYMENT",
      -      "type": "string"
      -    },
      -    "store_name": {
      -      "type": "string"
      -    },
      -    "subtotal_cents": {
      -      "type": "number"
      -    }
      -  },
      -  "required": [
      -    "cart_id",
      -    "store_name",
      -    "items",
      -    "subtotal_cents",
      -    "currency",
      -    "status",
      -    "agent_session_id",
      -    "session_state",
      -    "display_context"
      -  ],
      -  "type": "object"
      -}New value: +null
  6. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing required payment-mandate headers (and their currency-match denial rule), optional Skyfire trust-token effects, credential requirements, and the absence of human login. It also warns that invalid tokens proceed with a neutral trust score and that the max_amount cap is enforced.

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?

The description is long, but the SKYFIRE TOKEN / PAYMENT MANDATE / CREDENTIAL labels make it scannable, and the core purpose is front-loaded. Nearly every sentence carries operational information; only the incorrect `agent_key` reference keeps it from being fully reliable and tidy.

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

Completeness3/5

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

For a state-changing tool with auth and mandate requirements, it covers a great deal: prerequisites, headers, trust-score effects, and downstream usage. However, the central credential-preservation step is inaccurate (`agent_key` vs the schema's actual parameters), and it never explains how the agent determines the cart's currency to satisfy the mandate's currency-match rule.

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

Parameters2/5

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

The schema has 100% description coverage, so baseline would be 3, but the description introduces an `agent_key` argument that does not exist in the input schema, which has additionalProperties: false. An agent following this instruction would submit an invalid tool call; the description does not map the create_sandbox_key output to the actual `agent_token`, `display_context`, or `agent_session_id` parameters.

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?

Opens with a specific verb and resource: 'Create a shopping cart in Demo Store,' and distinguishes itself from checkout/shipping siblings by stating it returns a cart_id for use with get_shipping_rates, preview_checkout, and complete_checkout. This is unambiguous and separates it from create_sandbox_key and the ucp_* checkout tools.

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?

Provides explicit execution context: call create_sandbox_key first, pass the returned credential (or Bearer header), and do not attempt human login. It also places the tool in a sequence with get_shipping_rates, preview_checkout, and complete_checkout. It stops short of naming alternate cart/checkout tools or exclusion conditions, so it is strong but not a full when/when-not guide.

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