Skip to main content
Glama

AIFEC

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
qtyNo
product_idYes
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_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior3/5

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

The only annotation is readOnlyHint=false, so the description carries the behavioral burden and does it well: it discloses the fixed-price constraint, the need=options failure mode for variant products, and the already_in_cart no-op with its exception. It stops short of stating what the success response contains or whether adding is reversible, but the mutation semantics are otherwise clear.

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-loads the core action, then failure modes and the alternative in a logical order. It is dense and parenthetical-heavy but every clause carries operational information; no filler sentences.

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 4-param mutation with no output schema, the description covers return signals (need=options, already_in_cart), the price constraint, and the variant flow. The remaining omissions are numeric bounds on qty and an explicit statement of what a successful add returns.

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?

With only 25% schema coverage the description must compensate, and it does for the two most important params: variant_id's requirement and the need=options signal, and qty via "add units" / "the exact number" phrasing. It adds nothing about qty's 1-99 bound and only indirectly implies product_id's role, leaving a small gap.

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 units of a product to the customer's cart") and explicitly separates itself from cart_update for the quantity-change case. An agent can distinguish this from cart_update and cart_view without opening any 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?

Gives explicit routing rules: use cart_update with an exact number to change quantity, call again with variant_id after asking the customer, and the exception where already_in_cart should be ignored if the customer asked for more in this message. Alternatives and conditions are named rather than inferred.

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