Skip to main content
Glama

select_shipping_option

Idempotent

Select a shipping method for the cart. Must call get_shipping_rates first and provide idempotency_key. Reuse the same key for retries of the same cart and option; use a new key if either changes.

PREFER THE CART CARD: if there is an interactive card for this cart, let the buyer pick shipping there instead of calling this tool yourself — it keeps the flow in one card instead of opening a new one per step.

SKYFIRE TOKEN (optional): Pass a kya or kya-pay token in the skyfire-pay-id header to boost trust score. No token required — request proceeds normally if omitted. Checkout guide: https://trusteed.xyz/.well-known/agent-checkout-guide.json. 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
cart_idYesCart session ID
agent_keyNoSandbox credential from `create_sandbox_key`. Use this when your client cannot set an `Authorization: Bearer` header.
idempotency_keyYesRequired. Reuse this key only when retrying the same cart and shipping option; use a new key if either changes.
shipping_handleYesShipping method handle from get_shipping_rates

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cart_idYes
currencyYes
total_centsYes
selected_titleYes
shipping_centsYes
subtotal_centsYes
selected_handleYes
shipping_sourceYes
shipping_authoritativeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / idempotency_key
      Added value: +{
      +  "description": "Required. Reuse this key only when retrying the same cart and shipping option; use a new key if either changes.",
      +  "maxLength": 128,
      +  "minLength": 1,
      +  "pattern": "^[A-Za-z0-9._:/-]{1,128}$",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "cart_id",
      -  "shipping_handle"
      -]New value: +[
      +  "cart_id",
      +  "shipping_handle",
      +  "idempotency_key"
      +]
  2. Changed1 schema field changed
    • removedInput schema / properties / payment_mandate
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "additionalProperties": {},
      -      "type": "object"
      -    },
      -    {
      -      "type": "string"
      -    }
      -  ],
      -  "description": "Payment mandate with `mandate_id`, `max_amount_cents` (integer, minor units), `currency` (3 letters, must match the cart's), `exp` (expiry as an INTEGER of Unix seconds — not an ISO 8601 date string), `sub` (your agent id) and `aud` (the store slug this mandate is for, e.g. the slug in the URL you are calling — not a domain). Use this when your client cannot set an `X-Payment-Mandate` header."
      -}
  3. Changed1 schema field changed
    • changedInput schema / properties / payment_mandate / description
      Previous value: -"Payment mandate with `mandate_id`, `max_amount_cents`, `currency`, `exp`, `sub`, `aud`. Its `currency` must match the cart's. Use this when your client cannot set an `X-Payment-Mandate` header."New value: +"Payment mandate with `mandate_id`, `max_amount_cents` (integer, minor units), `currency` (3 letters, must match the cart's), `exp` (expiry as an INTEGER of Unix seconds — not an ISO 8601 date string), `sub` (your agent id) and `aud` (the store slug this mandate is for, e.g. the slug in the URL you are calling — not a domain). Use this when your client cannot set an `X-Payment-Mandate` header."
  4. Changed2 schema fields changed
    • addedInput schema / properties / agent_key
      Added value: +{
      +  "description": "Sandbox credential from `create_sandbox_key`. Use this when your client cannot set an `Authorization: Bearer` header.",
      +  "type": "string"
      +}
    • addedInput schema / properties / payment_mandate
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {},
      +      "type": "object"
      +    },
      +    {
      +      "type": "string"
      +    }
      +  ],
      +  "description": "Payment mandate with `mandate_id`, `max_amount_cents`, `currency`, `exp`, `sub`, `aud`. Its `currency` must match the cart's. Use this when your client cannot set an `X-Payment-Mandate` header."
      +}
  5. Changed2 schema fields changed
    • changedInput schema / additionalProperties
      Previous value: -falseNew value: +true
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +true
  6. Changed3 schema fields changed
    • addedOutput schema / properties / shipping_authoritative
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / shipping_source
      Added value: +{
      +  "enum": [
      +    "platform",
      +    "merchant_policy",
      +    "estimated"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "cart_id",
      -  "selected_handle",
      -  "selected_title",
      -  "shipping_cents",
      -  "subtotal_cents",
      -  "total_cents",
      -  "currency"
      -]New value: +[
      +  "cart_id",
      +  "selected_handle",
      +  "selected_title",
      +  "shipping_cents",
      +  "subtotal_cents",
      +  "total_cents",
      +  "currency",
      +  "shipping_source",
      +  "shipping_authoritative"
      +]
  7. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "cart_id": {
      +      "type": "string"
      +    },
      +    "currency": {
      +      "type": "string"
      +    },
      +    "selected_handle": {
      +      "type": "string"
      +    },
      +    "selected_title": {
      +      "type": "string"
      +    },
      +    "shipping_cents": {
      +      "type": "number"
      +    },
      +    "subtotal_cents": {
      +      "type": "number"
      +    },
      +    "total_cents": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "cart_id",
      +    "selected_handle",
      +    "selected_title",
      +    "shipping_cents",
      +    "subtotal_cents",
      +    "total_cents",
      +    "currency"
      +  ],
      +  "type": "object"
      +}
  8. 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: +{
      +  "cart_id": {
      +    "description": "Cart session ID",
      +    "type": "string"
      +  },
      +  "shipping_handle": {
      +    "description": "Shipping method handle from get_shipping_rates",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / required
      Added value: +[
      +  "cart_id",
      +  "shipping_handle"
      +]
  9. 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: -{
      -  "cart_id": {
      -    "description": "Cart session ID",
      -    "type": "string"
      -  },
      -  "shipping_handle": {
      -    "description": "Shipping method handle from get_shipping_rates",
      -    "type": "string"
      -  }
      -}
    • removedInput schema / required
      Removed value: -[
      -  "cart_id",
      -  "shipping_handle"
      -]
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": false,
      -  "properties": {
      -    "cart_id": {
      -      "type": "string"
      -    },
      -    "currency": {
      -      "type": "string"
      -    },
      -    "selected_handle": {
      -      "type": "string"
      -    },
      -    "selected_title": {
      -      "type": "string"
      -    },
      -    "shipping_cents": {
      -      "type": "number"
      -    },
      -    "subtotal_cents": {
      -      "type": "number"
      -    },
      -    "total_cents": {
      -      "type": "number"
      -    }
      -  },
      -  "required": [
      -    "cart_id",
      -    "selected_handle",
      -    "selected_title",
      -    "shipping_cents",
      -    "subtotal_cents",
      -    "total_cents",
      -    "currency"
      -  ],
      -  "type": "object"
      -}New value: +null
  10. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already signal idempotentHint=true and non-destructive, but the description adds substantially more: the exact idempotency reuse rule, the optional skyfire token behavior ('request proceeds normally if omitted'), and the hard credential requirement with the remedy (call create_sandbox_key, pass agent_key or a Bearer header, no human login). This is far beyond what the annotations convey.

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 prerequisite, then separated into labeled sections (cart card preference, skyfire token, credential) that are each actionable rather than padding. It is longer than typical, but the credential/Auth detail is operational information the agent genuinely needs, so only minor tightening is possible.

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 4-param mutation with an output schema, the description covers the prerequisite call, the credential bootstrap path, idempotency semantics, and an alternative UI flow. Nothing an agent needs to invoke it correctly appears to be missing.

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 schema alone would justify a baseline 3, but the description adds real value: it explains why idempotency_key exists and when to regenerate it, and it names the source of shipping_handle (get_shipping_rates) and agent_key (create_sandbox_key). Only marginal gain remains over the schema text, which already repeats the idempotency guidance.

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 precise verb+resource ('Select a shipping method for the cart') and immediately distinguishes itself from the sibling get_shipping_rates by declaring it a prerequisite. An agent can tell exactly what this tool does and how it relates to the rates tool without reading either schema.

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?

Gives explicit ordering ('Must call get_shipping_rates first'), an explicit when-not-to-use path ('PREFER THE CART CARD... let the buyer pick shipping there instead of calling this tool yourself'), and retry rules for the idempotency key. Alternatives and selecting conditions are all named.

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