Skip to main content
Glama

add_to_cart

Add the current session configuration to the cart. Calls the add-to-cart endpoint which translates the session's selections into the format required by the external cart service.

On success, returns a clientKey (anonymous cart identifier) and a cartLink (shareable URL to view the cart). These are also persisted on the session and will appear in all subsequent session responses.

If neither clientKey nor userId is provided, a new anonymous cart is created. Repeat calls add the item again (no idempotency).

Files are attached automatically. If the session was linked to a file session (via create_file_session with productConfigSessionId, link_file_session, or create_config_session called with a fileSessionId), the backend resolves the file session from the configuration session — you do NOT need to pass fileSessionId. Only pass fileSessionId to override that durable link with a specific file session.

The cartLink opens the cart on the Smartpress website, where the customer reviews the order and checks out.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sessionId": "<sessionId>"
    },
    "name": "add_to_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
userIdNoOptional user identifier for authenticated carts
jobNameNoOptional custom job name. Defaults to the product name if not provided.
clientKeyNoOptional anonymous cart identifier. If omitted, uses the session's persisted clientKey or creates a new cart.
sessionIdYesConfiguration session ID (UUID)
fileSessionIdNoOptional override. Normally omit this — the backend resolves the file session from the durable config<->file link. Only set it to force a specific file session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: return values (clientKey, cartLink), that they persist on the session and reappear in later responses, the non-idempotency of repeat calls, automatic file attachment resolution, and that the cartLink leads to an external checkout page. This is exactly the extra behavior an agent needs for a non-readonly, non-idempotent call.

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?

Front-loaded with the action and result values, then paragraphs for cart creation, file attachment, and the checkout URL. Slightly long, and the file-attachment paragraph names three sibling tools in a parenthetical, but nearly every sentence carries actionable information.

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?

No output schema exists, and the description compensates by describing returned fields and their persistence. Combined with annotations covering safety hints and full schema coverage, an agent has everything needed to invoke 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 baseline is 3, but the description genuinely adds meaning: the clientKey/userId fallback rule, and the fileSessionId override-vs-durable-link distinction with guidance to normally omit it. Only jobName goes unmentioned in prose.

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 ('Add the current session configuration to the cart') and names the backend endpoint it calls. It is clearly distinguishable from siblings like create_config_session or update_config_session because it is the terminal cart action.

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?

Explains the anonymous-cart case ('If neither clientKey nor userId is provided, a new anonymous cart is created') and explicitly says when NOT to pass fileSessionId, referencing the sibling tools that establish the link. It stops short of an explicit use-this-instead-of-X routing statement, but the conditional guidance is strong.

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