Skip to main content
Glama

Deporte Total

cart_add

Add units of a product to the customer's cart. The price is always the shop's own; it cannot be given. A product with variants needs its variant_id: without it you get need=options with the choices (the shop shows them as buttons): ask which one the customer wants and call again with that variant_id. If the product is already in the cart it returns already_in_cart and adds nothing (unless the customer asked for more in this message): to change how many there are, use cart_update with the exact number.

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": {
      "product_id": "<product_id>"
    },
    "name": "cart_add"
  }
}

Input Schema

NameRequiredDescriptionDefault
qtyNoHow many units to add
product_idYesThe id of the product, from search_products
session_idNoOnly if your client does not keep the MCP session (the Mcp-Session-Id header): the session_id that an earlier answer of this server gave you. It keeps the same cart between calls.
variant_idNoThe id of the variant (colour, size…), from get_product; 0 for a product without variants

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare the mutation profile (readOnly=false, idempotent=false, destructive=false), so the bar is lower, yet the description adds substantial behavior: price cannot be supplied, a variant product without variant_id yields need=options with choices, and a repeated add returns already_in_cart and adds nothing. These response contracts are exactly what an agent needs and are not in the annotations.

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 core action is front-loaded and each sentence carries operational information. The middle section is dense and slightly run-on, but nothing is redundant filler.

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?

For a mutating tool with no output schema, the description covers the important non-success returns (need=options, already_in_cart) and the variant prerequisite. It stops short of describing the success payload (e.g., resulting cart shape), which is a minor gap given cart_view exists.

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 3 is the baseline, but the description adds meaning beyond the schema: it explains the functional consequence of omitting variant_id (options flow) and reinforces that no price argument should be attempted. It doesn't add detail on qty bounds or session_id, but the schema already documents those.

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 first sentence states a specific verb and resource ('Add units of a product to the customer's cart') and the last sentence explicitly distinguishes it from the sibling cart_update. An agent can tell which tool to pick without opening either 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?

Explicit routing: ask the customer which variant when need=options is returned, and use cart_update with the exact number to change quantities rather than adding again. It also carves out the one condition where re-adding is fine ('unless the customer asked for more in this message').

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