Skip to main content
Glama

Render cart preview

render_cart_preview
Read-onlyIdempotent

Shows a cart drawer as shoppers will see it: a PNG of the saved cart with a sample cart inside, plus a link to the same page. After create_cart or update_cart, render the cart, compare the picture with the merchant's screenshot or wishes, and patch what differs with update_cart. Repeat until it matches or after five rounds. The sample cart holds two lines, so a reward bar shows mid-way; view empty shows the empty cart. For an A/B test, version shows version B, C or D.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "render_cart_preview"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoCart id from list_carts. Default: the live cart, or the store's only cart.
viewNocart (default) or empty.
scaleNoPixel density. Default 2, so the picture is twice the width in pixels.
widthNoDrawer width in px. Default: the cart's own width.
versionNoA/B test version. Default A, the live item. B, C and D change only while the test is a draft.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / id / description
      Previous value: -"Cart id from list_carts. Default: the live cart."New value: +"Cart id from list_carts. Default: the live cart, or the store's only cart."
  2. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description adds valuable context beyond that: the preview embeds a two-line sample cart (so a reward bar appears mid-way), the output is a PNG plus a page link, and the iteration loop is capped at five rounds. It does not mention permissions or rate limits, which keeps it just short of 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, each earning its place: output description first, then the iteration workflow, then the sample-cart and empty-view caveats, then the A/B test note. No filler or restatement of the tool name.

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?

Although there is no output schema, the description explains the return value (PNG plus link), the default cart selection behavior, and the full render-compare-patch loop. With all five parameters optional and fully documented, an agent has everything needed to call it correctly.

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, but the description adds real meaning: it explains why the sample cart matters (two lines produce a mid-way reward bar), what 'empty' shows, and that version selects the B/C/D variant used in A/B tests. That goes beyond the schema's terse enum labels.

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 concrete verb and resource ('Shows a cart drawer as shoppers will see it') and names the exact deliverable: a PNG plus a link to the same page. This clearly distinguishes it from sibling preview tools such as render_bundle_preview and render_section_preview, which render different resources.

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 an explicit workflow: call after create_cart or update_cart, compare the picture with the merchant's screenshot, patch differences with update_cart, and repeat up to five rounds. It also states when to use the 'empty' view and when to use 'version' for an A/B test, so an agent knows both the entry point and the alternatives.

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