Skip to main content
Glama

create_draft_order

Create a new draft order for editable carts or quotes. Add product variants or custom items, then attach a customer or send an invoice URL for payment.

Instructions

Create a new draft order — Shopify's term for an editable cart/quote not yet placed as an order. Each line item is EITHER a variant reference (variantId + quantity) for catalog products, OR a custom item (title + originalUnitPrice + quantity) for one-off charges or services not in the catalog. Optionally attach a customer, email, internal note, tags, and choose whether to copy the customer's default address. Returns the new draft's GID and an invoice URL the customer can use to pay. Drafts stay OPEN until you call complete_draft_order or send the invoice.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineItemsYesAt least one line item. Each item is EITHER a variant reference (just variantId + quantity) OR a custom item (title + originalUnitPrice + quantity, no variantId). Mixing both shapes in one item is rejected by the refine() validator.
customerIdNoGID of an existing customer to attach to the draft. Get one from list_customers. Optional — drafts can be customer-less and converted to a guest checkout.
emailNoEmail address for the order. Useful when you don't have a customer record yet but want to email the invoice URL.
noteNoInternal note visible to staff only (not the customer).
tagsNoTags to apply to the draft for filtering/segmentation.
useCustomerDefaultAddressNoIf true and customerId is set, copy the customer's default shipping address onto the draft.
Behavior5/5

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

Despite no annotations, the description thoroughly discloses behavior: line item constraints (variant vs custom), optional attachments, draft state (OPEN), and return values (GID, invoice URL). No contradictions.

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 informative but slightly verbose with multiple clauses. However, every sentence adds value and it is well front-loaded with the purpose. Could be slightly tighter but effective.

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 complex tool with 6 parameters and no output schema, the description provides all necessary context: line item rules, optional fields, draft lifecycle, and return values. High completeness given the schema coverage.

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?

Schema coverage is 100%, and the description adds substantial detail: explains line item shapes, rejection of mixed shapes, purpose of email vs customerId, and distinction between custom and variant items. Exceeds schema alone.

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 clearly states it creates a draft order (editable cart/quote), distinguishing it from related tools like complete_draft_order and create_order. It provides specific Shopify terminology and context.

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?

The description explains when to use (for editable carts/quotes) and mentions subsequent actions (complete_draft_order or send invoice). It implicitly distinguishes from create_order but lacks explicit 'when not to use' or direct alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/miller-joe/shopify-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server