Skip to main content
Glama

create_cart_link

Read-onlyIdempotent

Build a link that puts the given products into the customer's cart.

This tool writes nothing. It returns a URL; the products are added only when the customer opens that URL in their own browser. Give the URL to the customer and let them click it.

Args: items: 1-20 rows of {"product_id": int >= 1, "quantity": int 1-50}. Unknown fields are rejected. Repeated product_ids are merged into one row and their quantities summed. checkout: If True, opening the link takes the customer straight to checkout; if False (default) it opens the cart review page.

Returns: JSON with cart_url, the normalised items, item_count, total_quantity, the echoed checkout flag and a short note to show the customer.

Errors (isError=true, body {"error": {...}}): - products_not_found: one or more product_ids do not exist or are not published. The message lists the offending ids. - shop_api_unavailable: the shop could not be reached; retryable.

Notes: - The link SETS the quantities, it does not add to what is already in the cart. Opening the same link twice gives the same result as opening it once, so the customer can safely click it again. - Stock is re-checked when the link is opened. If stock ran out in the meantime, the quantity is reduced or the row skipped — the link can never oversell. - Checkout requires a customer account, so the customer may be asked to log in or register before paying.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes1-20 products to put in the cart
checkoutNoIf True, the link goes straight to checkout; otherwise (default) to the cart review page

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteYes
itemsYes
cart_urlYesOpen in a browser to fill the cart
checkoutNoTrue if the link goes straight to checkout, False to cart review
item_countYesNumber of distinct products
total_quantityYesSum of quantities

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description adds key behaviors: the link sets quantities rather than adds, is idempotent (clicking twice gives same result), stock is re-checked with potential quantity reduction or row skipping, and checkout requires customer account. This goes well beyond the annotation flags and provides rich operational detail.

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 lengthy but well-structured into Args, Returns, Errors, and Notes sections. Each sentence adds value, though there is slight redundancy with annotations (e.g., 'writes nothing'). It could be tighter, but the organization aids readability.

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?

Given the tool's complexity, the description covers purpose, parameters, return format, error handling, and nuanced behaviors (idempotency, stock re-check, checkout auth). With an output schema and annotations present, the description provides comprehensive guidance for an agent to select and invoke the tool correctly.

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?

Even though schema coverage is 100%, the description adds crucial semantics: repeated product_ids are merged with quantities summed, unknown fields are rejected, explicit ranges for items and quantity, and the effect of the checkout flag. This adds meaning beyond the raw schema and helps the agent construct valid inputs.

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 'Build a link that puts the given products into the customer's cart' – a specific verb+resource that clearly distinguishes it from sibling query tools. It also clarifies the tool writes nothing and returns a URL, leaving no ambiguity about its function.

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?

Provides clear context: 'Give the URL to the customer and let them click it.' Implicitly distinguishes from sibling tools (which are for querying) but doesn't explicitly state when not to use or name alternatives. The use case is evident, though not exhaustive.

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.

TDQS

A4.3/5.0
Disambiguation2/5

search_catalog and search_shop_catalog are exact duplicates with identical descriptions and arguments, making it impossible for an agent to distinguish them. The other three tools are distinct, but having two tools that do the same thing creates genuine ambiguity.

Naming Consistency4/5

All tool names follow a consistent verb_noun snake_case pattern (create_, get_, search_). However, the duplicate functionality is named inconsistently (search_catalog vs search_shop_catalog), which is a minor deviation from naming clarity.

Tool Count4/5

With 5 tools the count is within the reasonable range for a shop catalog server. However, one tool is redundant, effectively reducing the unique functionality to 4 tools, which is still acceptable but not ideal.

Completeness4/5

The tool surface covers product search, product details, cart link creation, and policy lookup, which are the core operations for a catalog-driven shop. Minor gaps exist (e.g., no direct category listing) but these are mitigated by external REST endpoints and the tools work together for common workflows.

Resources