Skip to main content
Glama

Create shipment for order

create_shipment_for_order
Destructive

Buy a shipment (label) for an existing order and link it to that order. A purchase spends account balance. Without rate_id it quotes the order, waits until every carrier answered and buys the cheapest priced rate. To buy the rate the user chose, pass rate_id with its quotation_id; it is bought only after checking it belongs to this order. With auto_select=false it never buys, even with a rate_id. Purchase fields (package_type, consignment_note, contacts) follow create_shipment; never fabricate contacts or addresses. When the server enforces confirmation, a call without _confirm: true is not executed and answers status confirmation_required; _preview: true returns the plan without executing. Purchases are deduplicated per rate as in create_shipment; after WRITE_OUTCOME_UNKNOWN, check list_order_labels or list_shipments before retrying. The label is generated asynchronously, so label_url and tracking_number on the packages can still be empty; check get_shipment later. Use create_shipment instead for a standalone shipment with no order, and create_external_shipment for a label bought outside Skydropx. Returns the shipment under data, packages and addresses in included. When nothing is bought: status: 'pending' with a quotation_id (carriers still pricing: call again with it), the rates to choose from (auto_select=false), or an mcp_next_step to call once the user confirms.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "order_id": "<order_id>"
    },
    "name": "create_shipment_for_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
carrierNoRestrict auto-select to this carrier name/code
rate_idNoId of the rate the user chose, from the rates this tool (auto_select=false) or get_quotation returned in this conversation. Requires quotation_id.
_confirmNoExplicit confirmation for actions that spend money or destroy state, when the server enforces confirmation
_previewNoDry run: return the plan without executing anything
order_idYesId of the existing order to ship, from list_orders / get_order / create_order in this conversation (never a shipment or quotation id). The label is linked to it.
packagesNoPer-package content, packaging and protection; the amount to collect stays as quoted
productsNoLine items; required on international routes and where the origin country demands them
protectedNoInsure the label at purchase: the protection is charged with it and needs declared_value. Quote with package_protected first so the user sees its price.
address_toNoOverride DESTINATION (recipient) contact/address details
mandate_idNoAgent mandate this action is taken under (audited server-side)
auto_selectNoPurchase automatically (default true). false never purchases.
address_fromNoOverride ORIGIN (sender) contact/address details — must match the quotation's address_from party, never the recipient
package_typeNoPackaging code — you MUST take it from a `list_packagings` result in THIS conversation (match the user's plain words, e.g. 'caja de cartón', against that catalog). Never invent or reuse a remembered code.
quotation_idNoThe quotation_id returned together with the rates by this tool or get_quotation
office_pickupNoThe sender drops the parcel off at a carrier branch (no home pickup). Only for a rate whose `office_pickup` is true; requires office_pickup_point_id.
declared_valueNoValue to insure, in the account's currency; required (above 0) when `protected` is true
nfe_access_keyNoNota Fiscal access key when one was already issued (BR)
idempotency_keyNoClient-generated key forwarded as an Idempotency-Key header. It does NOT by itself guarantee deduplication: after a WRITE_OUTCOME_UNKNOWN error, check the current state (e.g. list_shipments / get_shipment) before retrying.
office_deliveryNoEntrega en sucursal / ocurre: the recipient collects at a carrier branch instead of home delivery. Only for a rate whose `office_delivery` is true (see the quotation's `mcp_office`); requires office_delivery_point_id. A rate with `office_delivery_only` cannot be bought without it.
package_contentNoWhat is being shipped, in the user's plain words (e.g. 'Zapatillas')
printing_formatNoLabel format: standard or thermal. Omitted, the account's saved preference applies. Thermal on a carrier without thermal labels is refused with a validation error, whether sent here or coming from a saved thermal preference: send standard for such a carrier.
cash_on_deliveryNoAccepted but not applied here: cash on delivery is taken from the quotation, so set it (with declared_amount) on quote_shipment.
consignment_noteNoCarta-porte SAT code — you MUST take it from a `list_consignment_notes` search in THIS conversation (search with the user's plain words, e.g. 'zapatillas'). Never invent or reuse a remembered code.
shipment_purposeNoPurpose of the shipment. REQUIRED for international shipments
fiscal_document_modeNoFiscal document mode (BR flows)
include_order_detailNotrue asks for an order-detail PDF with the label; when one is generated its link is attributes.order_detail_url (default false)
customs_payment_payerNoWho pays customs. REQUIRED for international shipments
office_pickup_point_idNoOrigin branch id chosen by the user from list_office_points(rate_id, direction: 'pickup') for THIS rate
recipient_pays_shippingNoAccepted but not applied here: taken from the quotation, so set it on quote_shipment.
office_delivery_point_idNoDestination branch id chosen by the user from list_office_points(rate_id, direction: 'delivery') for THIS rate

Output Schema

NameRequiredDescriptionDefault
dataNoThe purchased shipment; absent when nothing was bought
noteNoPresent when the rates are partial
ratesNoPriced rates for the user to choose
statusNo'pending' while carriers are still pricing
messageNo
completeNoWhether every carrier answered (auto_select=false)
includedNoSideloaded JSON:API records (id, type, attributes) referenced from relationships; absent when nothing is sideloaded
order_idNoThe order; present when nothing was bought
purchasedNofalse when nothing was bought
quotation_idNoQuotation to re-read with get_quotation or pass back
mcp_next_stepNoServer-added hint naming the next tool to call; absent when there is no next step

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changed
    • addedInput schema / properties / address_from / properties / apartment_number / description
      Added value: +"Número interior / apartment or suite, 10 characters max"
    • addedInput schema / properties / address_from / properties / company / description
      Added value: +"Company name when the party is a business, 60 characters max"
    • changedInput schema / properties / address_from / properties / further_information / description
      Previous value: -"Extra delivery instructions"New value: +"Extra delivery instructions, 70 characters max"
    • addedInput schema / properties / address_from / properties / name / description
      Added value: +"Contact full name, 3 to 30 characters"
    • changedInput schema / properties / address_from / properties / reference / description
      Previous value: -"Delivery reference (landmark). Skydropx may require it to buy a label: use what the user or the quotation provided, ask the user when it is missing, never make one up. MAX 30 chars for the origin address, 40 for the destination."New value: +"Delivery reference (landmark). REQUIRED on both origin and destination to buy a label (except BR); the purchase is refused when either is blank. Use what the user or the quotation provided, ask the user when it is missing, never make one up. MAX 30 chars for the origin address, 40 for the destination."
    • addedInput schema / properties / address_from / properties / street1 / description
      Added value: +"Calle y número / street incl. number, 45 characters max in MX, e.g. 'Av. Insurgentes Sur 100'. Never the colonia, city or state (the rate already fixes them from the quotation)."
    • addedInput schema / properties / address_from / properties / street_number / description
      Added value: +"Street number on its own, Brazil only (5 characters max); elsewhere it goes in street1"
    • addedInput schema / properties / address_to / properties / apartment_number / description
      Added value: +"Número interior / apartment or suite, 10 characters max"
    • addedInput schema / properties / address_to / properties / company / description
      Added value: +"Company name when the party is a business, 60 characters max"
    • changedInput schema / properties / address_to / properties / further_information / description
      Previous value: -"Extra delivery instructions"New value: +"Extra delivery instructions, 70 characters max"
    • addedInput schema / properties / address_to / properties / name / description
      Added value: +"Contact full name, 3 to 30 characters"
    • changedInput schema / properties / address_to / properties / reference / description
      Previous value: -"Delivery reference (landmark). Skydropx may require it to buy a label: use what the user or the quotation provided, ask the user when it is missing, never make one up. MAX 30 chars for the origin address, 40 for the destination."New value: +"Delivery reference (landmark). REQUIRED on both origin and destination to buy a label (except BR); the purchase is refused when either is blank. Use what the user or the quotation provided, ask the user when it is missing, never make one up. MAX 30 chars for the origin address, 40 for the destination."
    • addedInput schema / properties / address_to / properties / street1 / description
      Added value: +"Calle y número / street incl. number, 45 characters max in MX, e.g. 'Av. Insurgentes Sur 100'. Never the colonia, city or state (the rate already fixes them from the quotation)."
    • addedInput schema / properties / address_to / properties / street_number / description
      Added value: +"Street number on its own, Brazil only (5 characters max); elsewhere it goes in street1"
    • changedInput schema / properties / office_delivery / description
      Previous value: -"Recipient collects at a carrier office; requires office_delivery_point_id"New value: +"Entrega en sucursal / ocurre: the recipient collects at a carrier branch instead of home delivery. Only for a rate whose `office_delivery` is true (see the quotation's `mcp_office`); requires office_delivery_point_id. A rate with `office_delivery_only` cannot be bought without it."
    • changedInput schema / properties / office_delivery_point_id / description
      Previous value: -"Destination office point id from list_office_points (direction delivery) for this rate"New value: +"Destination branch id chosen by the user from list_office_points(rate_id, direction: 'delivery') for THIS rate"
    • changedInput schema / properties / office_pickup / description
      Previous value: -"Sender drops off at a carrier office; requires office_pickup_point_id"New value: +"The sender drops the parcel off at a carrier branch (no home pickup). Only for a rate whose `office_pickup` is true; requires office_pickup_point_id."
    • changedInput schema / properties / office_pickup_point_id / description
      Previous value: -"Origin office point id from list_office_points (direction pickup) for this rate"New value: +"Origin branch id chosen by the user from list_office_points(rate_id, direction: 'pickup') for THIS rate"
  2. Changed8 schema fields changed
    • addedInput schema / properties / cash_on_delivery / description
      Added value: +"Accepted but not applied here: cash on delivery is taken from the quotation, so set it (with declared_amount) on quote_shipment."
    • changedInput schema / properties / declared_value / description
      Previous value: -"Insured value; required when protecting the shipment"New value: +"Value to insure, in the account's currency; required (above 0) when `protected` is true"
    • addedInput schema / properties / include_order_detail / description
      Added value: +"true asks for an order-detail PDF with the label; when one is generated its link is attributes.order_detail_url (default false)"
    • addedInput schema / properties / packages / description
      Added value: +"Per-package content, packaging and protection; the amount to collect stays as quoted"
    • changedInput schema / properties / printing_format / description
      Previous value: -"e.g. standard / thermal"New value: +"Label format: standard or thermal. Omitted, the account's saved preference applies. Thermal on a carrier without thermal labels is refused with a validation error, whether sent here or coming from a saved thermal preference: send standard for such a carrier."
    • addedInput schema / properties / products / description
      Added value: +"Line items; required on international routes and where the origin country demands them"
    • addedInput schema / properties / protected / description
      Added value: +"Insure the label at purchase: the protection is charged with it and needs declared_value. Quote with package_protected first so the user sees its price."
    • addedInput schema / properties / recipient_pays_shipping / description
      Added value: +"Accepted but not applied here: taken from the quotation, so set it on quote_shipment."
  3. Changed10 schema fields changed
    • addedInput schema / properties / address_from / properties / address_template_id / description
      Added value: +"Saved address id: data[].id from list_address_templates or data.id from create_address_template"
    • addedInput schema / properties / address_to / properties / address_template_id / description
      Added value: +"Saved address id: data[].id from list_address_templates or data.id from create_address_template"
    • changedInput schema / properties / order_id / description
      Previous value: -"Id of the EXISTING order to ship, from list_orders / get_order / create_order in THIS conversation (never a shipment or quotation id). The label is linked to it."New value: +"Id of the existing order to ship, from list_orders / get_order / create_order in this conversation (never a shipment or quotation id). The label is linked to it."
    • addedInput schema / properties / packages / items / properties / products / items / properties / destination_country_id / description
      Added value: +"Country record id of the destination, as list_products reports it"
    • addedInput schema / properties / packages / items / properties / products / items / properties / product_id / description
      Added value: +"Catalog product id: data[].id from list_products"
    • addedInput schema / properties / products / items / properties / destination_country_id / description
      Added value: +"Country record id of the destination, as list_products reports it"
    • addedInput schema / properties / products / items / properties / product_id / description
      Added value: +"Catalog product id: data[].id from list_products"
    • changedInput schema / properties / quotation_id / description
      Previous value: -"The quotation_id returned together with the rates"New value: +"The quotation_id returned together with the rates by this tool or get_quotation"
    • changedInput schema / properties / rate_id / description
      Previous value: -"Rate the user chose. Requires quotation_id."New value: +"Id of the rate the user chose, from the rates this tool (auto_select=false) or get_quotation returned in this conversation. Requires quotation_id."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "A purchased shipment ({data, included}) or a no-purchase answer",
      +  "properties": {
      +    "complete": {
      +      "description": "Whether every carrier answered (auto_select=false)"
      +    },
      +    "data": {
      +      "description": "The purchased shipment; absent when nothing was bought",
      +      "properties": {
      +        "attributes": {
      +          "properties": {
      +            "carrier_name": {},
      +            "created_at": {},
      +            "estimated_delivery_days": {},
      +            "id": {
      +              "description": "Shipment id, for get_shipment / track_shipment / schedule_pickup"
      +            },
      +            "master_tracking_number": {
      +              "description": "Absent while the label is being generated"
      +            },
      +            "payment_status": {},
      +            "service_code": {},
      +            "service_name": {},
      +            "total": {
      +              "description": "Amount charged (decimal string)"
      +            },
      +            "workflow_status": {
      +              "description": "Label generation state"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "id": {
      +          "description": "Resource id"
      +        },
      +        "relationships": {
      +          "description": "Links to related records (see included)",
      +          "properties": {
      +            "packages": {
      +              "description": "The shipment's packages; each sideloaded package carries label_url, tracking_number and tracking_url_provider"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "type": {
      +          "description": "always 'shipment'"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "included": {
      +      "description": "Sideloaded JSON:API records (id, type, attributes) referenced from relationships; absent when nothing is sideloaded",
      +      "items": {},
      +      "type": "array"
      +    },
      +    "mcp_next_step": {
      +      "description": "Server-added hint naming the next tool to call; absent when there is no next step",
      +      "properties": {
      +        "arguments": {
      +          "description": "Arguments to pass to that tool, when known"
      +        },
      +        "collect_if_missing": {
      +          "description": "Inputs still to gather from the user before calling that tool, when any",
      +          "items": {},
      +          "type": "array"
      +        },
      +        "message": {
      +          "description": "Instruction for the agent"
      +        },
      +        "status": {
      +          "description": "State that motivated the hint, e.g. 'pending' or 'priced'"
      +        },
      +        "tool": {
      +          "description": "Name of the tool to call next"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {},
      +    "note": {
      +      "description": "Present when the rates are partial"
      +    },
      +    "order_id": {
      +      "description": "The order; present when nothing was bought"
      +    },
      +    "purchased": {
      +      "description": "false when nothing was bought"
      +    },
      +    "quotation_id": {
      +      "description": "Quotation to re-read with get_quotation or pass back"
      +    },
      +    "rates": {
      +      "description": "Priced rates for the user to choose",
      +      "items": {},
      +      "type": "array"
      +    },
      +    "status": {
      +      "description": "'pending' while carriers are still pricing"
      +    }
      +  },
      +  "type": "object"
      +}
  4. First observed

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true, idempotentHint=false and openWorldHint=true, so the mutation and open-world profile is known. The description adds real value beyond that: balance spend, the `_confirm: true` / confirmation_required gate, `_preview: true`, per-rate deduplication, and the safe retry path after WRITE_OUTCOME_UNKNOWN. It also warns that label_url and tracking_number can be empty because generation is asynchronous.

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 action and its cost are front-loaded, then decision rules, then confirmation/deduplication behavior, then sibling alternatives — a sensible order for a purchase tool. It is long, but for a 30-parameter money-spending tool nearly every clause carries operational weight; only a few return-shape details overlap the output schema.

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?

Covers the purchase gate, the confirmation and preview flags, the async label caveat, the no-purchase 'pending' outcomes (quotation_id, rates to choose from, mcp_next_step), and the wrong-tool cases. Nothing an agent needs to avoid an irreversible mistake is 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 description coverage is 100% and 30 parameters are richly documented, so the baseline is already high. The description still contributes cross-field rules the schema states only in fragments, notably that rate_id is bought only after verifying it belongs to this order and that auto_select=false suppresses purchase even when rate_id is supplied, plus the instruction never to fabricate contacts or addresses.

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 first sentence states a specific verb and resource ('Buy a shipment (label) for an existing order and link it to that order') and immediately discloses the cost consequence. It explicitly separates itself from create_shipment (standalone) and create_external_shipment (label bought outside Skydropx), so an agent can route correctly without opening any 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 concrete when-to-use branches: no rate_id means quote-then-buy-cheapest, rate_id plus quotation_id means buy the chosen rate, and auto_select=false never buys 'even with a rate_id'. It names the two alternative tools and the condition that selects each, leaving nothing to inference.

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