Skip to main content
Glama

Get Direct Checkout URL

checkout.links.get_direct_url
Read-only

Generate the direct 1-click checkout purchase URL for a specific product handle and size variant index (https://s.polopan.com/p/{handle}/{size_index}).

PURPOSE & DISAMBIGUATION:

WHEN TO USE:

  • ONLY after the user has explicitly selected and confirmed their size (e.g. 'I want size M' or 'size 40').

WHEN NOT TO USE:

  • Do NOT provide direct checkout URLs with /{size_index} during initial product browsing, shortlisting, or if size is ambiguous (use base link https://s.polopan.com/p/{handle}).

BEHAVIOR & SAFETY:

  • Read-only link generator with no persistent state modifications or charges.

  • Automatically resolves variant index if a size string (e.g. 'M', 'L') is provided without size_index.

  • Encodes optional coupon parameters and quantity parameters into the final URL.

PARAMETERS & CONSTRAINTS:

  • 'handle' (string, required): Unique product handle identifier.

  • 'size' (string, optional): Size label confirmed by user (e.g. 'M', 'L', 'XL', '42').

  • 'size_index' (integer >= 0, optional): Zero-based index of the chosen size variant.

  • 'quantity' (integer 1-10, default 1): Number of units to purchase.

  • 'coupon' (string, optional): Optional discount coupon code to pre-apply (e.g. 'SAVE15').

  • 'address_id' (string, optional): ID of specific saved address to prefill.

  • 'address' (object, optional): Delivery address object to prefill directly.

Input Schema

NameRequiredDescriptionDefault
sizeNoSize label confirmed by the user (e.g. 'M', 'L', 'XL', '40')
couponNoOptional discount coupon code to pre-apply in the checkout session
handleYesUnique product handle identifier (e.g. 'solid-linen-shirt', 'shopify_11206')
addressNoOptional ad-hoc address object to prefill
countryNoCountry name, city, currency, or 2-letter ISO code (e.g. 'US', 'United States', 'UK', 'Dubai', 'CA', 'IN'). Defaults to active saved region.
quantityNoNumber of units to purchase (1 to 10, default 1)
address_idNoOptional saved address ID to prefill
size_indexNoZero-based index of the chosen size variant

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedInput schema / properties / address
      Added value: +{
      +  "description": "Optional ad-hoc address object to prefill",
      +  "properties": {
      +    "address1": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "address2": {
      +      "type": "string"
      +    },
      +    "city": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "country": {
      +      "type": "string"
      +    },
      +    "email": {
      +      "type": "string"
      +    },
      +    "firstName": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "lastName": {
      +      "type": "string"
      +    },
      +    "phone": {
      +      "type": "string"
      +    },
      +    "province": {
      +      "type": "string"
      +    },
      +    "zip": {
      +      "minLength": 1,
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "firstName",
      +    "address1",
      +    "city",
      +    "zip"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / address_id
      Added value: +{
      +  "description": "Optional saved address ID to prefill",
      +  "type": "string"
      +}
    • addedInput schema / properties / country
      Added value: +{
      +  "description": "Country name, city, currency, or 2-letter ISO code (e.g. 'US', 'United States', 'UK', 'Dubai', 'CA', 'IN'). Defaults to active saved region.",
      +  "type": "string"
      +}
    • changedInput schema / properties / coupon / description
      Previous value: -"Optional discount coupon code to pre-apply"New value: +"Optional discount coupon code to pre-apply in the checkout session"
    • changedInput schema / properties / handle / description
      Previous value: -"Unique product handle identifier"New value: +"Unique product handle identifier (e.g. 'solid-linen-shirt', 'shopify_11206')"
    • changedInput schema / properties / quantity / description
      Previous value: -"Number of units to purchase (1-10)"New value: +"Number of units to purchase (1 to 10, default 1)"
    • changedInput schema / properties / size / description
      Previous value: -"Size label confirmed by the user (e.g. 'M', 'L', 'XL')"New value: +"Size label confirmed by the user (e.g. 'M', 'L', 'XL', '40')"
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": false,
      -  "properties": {
      -    "checkout_url": {
      -      "description": "Direct 1-click purchase permalink (https://s.polopan.com/p/{handle}/{size_index})",
      -      "type": "string"
      -    },
      -    "handle": {
      -      "description": "Product handle",
      -      "type": "string"
      -    },
      -    "size": {
      -      "description": "Selected size",
      -      "type": "string"
      -    },
      -    "size_index": {
      -      "description": "Selected size index",
      -      "type": "number"
      -    }
      -  },
      -  "required": [
      -    "handle",
      -    "size_index",
      -    "checkout_url"
      -  ],
      -  "type": "object"
      -}New value: +null
  2. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is partly covered. The description usefully adds that it is a 'read-only link generator with no persistent state modifications or charges,' auto-resolves the variant index when only a size string is given, and encodes coupon/quantity into the URL. It stops short of describing edge cases (e.g. invalid size_index, missing variant, coupon rejection), which keeps it below a 5.

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 sectioned structure (purpose, when-to-use, when-not, behavior, params) is front-loaded and scannable, with the key output template stated first. The parameter section duplicates schema content, adding some length that does not earn its place, but the overall brevity is acceptable for a tool with this much conditional logic.

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

Completeness4/5

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

There is no output schema, but the description compensates by specifying the generated URL format and the encoded inputs, so an agent knows what to expect back. Combined with 100% schema coverage on the input side, the definition is nearly complete; only finer handling details (auto-resolution failure, coupon application) are left implicit.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all eight parameters, and the description's 'PARAMETERS & CONSTRAINTS' section largely restates them. It adds a small amount of value by framing 'size' as user-confirmed and noting size_index is zero-based, but the nested address object is only described generically and the country parameter present in the schema is omitted from the description. Baseline 3 is appropriate.

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 and resource ('Generate the direct 1-click checkout purchase URL') and even gives the exact URL template. It explicitly distinguishes itself from browsing links by contrasting the /{handle} vs /{handle}/{size_index} forms, so an agent can separate it from sibling products.items.get_by_handle 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?

Provides explicit WHEN TO USE ('ONLY after the user has explicitly selected and confirmed their size') and WHEN NOT TO USE ('Do NOT provide direct checkout URLs during initial browsing, shortlisting, or if size is ambiguous') with a concrete alternative (the base link). This is precisely the routing guidance an agent needs.

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