Skip to main content
Glama

Get Direct Checkout URL

checkout.links.get_direct_url
Read-only

Generate a verified 1-click checkout URL for a chosen product size, with optional coupon and quantity. Resolve size labels to variant indexes to create a direct purchase link.

Instructions

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').

Input Schema

TableJSON 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')
quantityNoNumber of units to purchase (1 to 10, default 1)
size_indexNoZero-based index of the chosen size variant

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.5

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description reinforces this with 'Read-only link generator with no persistent state modifications or charges.' It adds further useful behavior: automatic resolution of size string to size_index and encoding of coupon/quantity parameters, going beyond what annotations provide.

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 well-organized with clear sections and front-loaded purpose. It is longer than necessary and repeats some details, such as the base-link distinction appearing in both the disambiguation and WHEN NOT sections, but the structure makes the content easy to scan and each section serves a clear purpose.

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?

The description covers purpose, disambiguation, usage rules, safety behavior, and parameter constraints comprehensively. The main minor gap is that, with no output schema, it does not explicitly state whether the tool returns a raw URL string, a wrapped object, or any error behavior, though the generated URL format is clearly indicated.

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 baseline is 3. The description adds meaning beyond the schema by explaining how 'size' and 'size_index' relate, noting that a size string can be auto-resolved when no index is provided, and clarifying how the final URL is assembled from 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?

The description states a specific verb and resource: 'Generate the direct 1-click checkout purchase URL for a specific product handle and size variant index' and provides the exact URL pattern. It clearly distinguishes this tool from general browsing links, making it unambiguous and differentiable from sibling product-lookup tools.

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?

The description has explicit 'WHEN TO USE' and 'WHEN NOT TO USE' sections: it should be used only after the user confirms a size, and must not be used during browsing or when size is ambiguous. It even names the alternative base link (https://s.polopan.com/p/{handle}), giving the agent direct decision criteria.

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