Skip to main content
Glama

Klack Europe Shopping

Añadir o establecer cantidad

add_to_cart
Destructive

Añade un artículo al carrito temporal o SUSTITUYE su cantidad total si ya existe (repetir la misma petición no duplica unidades). El cambio es reversible con set_cart_quantity; no genera pedidos ni realiza cobros. Una variación requiere su ID concreto. Máximo 99 unidades y 30 líneas.

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": {
      "cart_token": "<cart_token>",
      "product_id": "<product_id>",
      "quantity": "<quantity>"
    },
    "name": "add_to_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
quantityYes
cart_tokenYesToken opaco recibido de create_cart. No es un token de pago.
product_idYesID de producto simple o ID de variación seleccionada.

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?

Annotations flag destructiveHint=true, and the description justifies that flag by disclosing that the total quantity is overwritten rather than incremented. It goes further than the annotations with the practical reassurances an agent needs: no order creation, no charge, reversible via set_cart_quantity, and hard caps of 99 units and 30 lines.

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?

Three tight sentences, front-loaded with the add-vs-replace rule that is the only thing likely to cause a wrong call. Each following clause carries a distinct operational fact (idempotency, reversibility, variation ID, limits) with no 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 non-read-only, no-output-schema mutation, the description covers side effects, reversibility, and limits well. It doesn't say what state is returned or what happens on failure (e.g. cart full at 30 lines, invalid variation), which would help an agent recover from errors.

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 67%, and the description closes most of the gap by explaining that product_id must be the specific variation ID when a variation is wanted, and that quantity is a total, not a delta, with a 99 ceiling. cart_token semantics are already carried by the schema itself, so the remaining gap is minor.

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 a concrete verb and resource and immediately resolves the ambiguity an agent would have: it adds an item OR replaces its total quantity if it already exists. That upsert semantics plus the note that repeating the request is idempotent distinguishes it cleanly from a pure 'set quantity' tool, so no schema reading is needed to pick it.

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?

It gives the trigger condition (item absent vs. present) and names set_cart_quantity as the path to reverse the change. It stops short of explicitly framing when an agent should prefer set_cart_quantity over this tool for an existing line, but the reversible-with pointer is enough context for a competent agent.

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