Skip to main content
Glama

Agregar al carrito

agregar_al_carrito
Read-onlyIdempotent

Agrega un producto al carrito de esta compra (o lo resta con cantidad negativa; en 0 se quita). La primera vez no mandes 'carrito'; después manda siempre el token 'carrito' que te devolvió la llamada anterior. Devuelve el carrito con total y envío. Para cerrar: crear_pedido con ese 'carrito'.

Input Schema

NameRequiredDescriptionDefault
carritoNoToken del carrito (c1.…) de la llamada anterior. Vacío = carrito nuevo.
cantidadNoPiezas a sumar (1 por omisión). Negativo resta.
producto_idYesid del producto (p-...) de buscar_productos.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior1/5

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

The description says the tool adds, subtracts and removes items from a cart — a state mutation — while annotations declare readOnlyHint=true and idempotentHint=true (repeated calls with the same cantidad accumulate, so they are not idempotent either). The helpful details about the token and return value are overshadowed by this direct conflict.

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 short sentences, each carrying operational information (mutation semantics, token chaining, return payload, closing step), with the core purpose front-loaded and 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?

Even without an output schema, the description tells the agent what comes back (el carrito con total y envío) and how to continue the flow with crear_pedido. The one gap is that it never warns that the cart token is session-scoped or how it relates to ver_carrito, though that is minor.

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, and the description earns above that by adding behavior the schema does not state: cantidad=0 removes the item entirely, and the carrito token must come from the previous call. It still does not explain producto_id sourcing in the prose, but the schema covers it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (agrega un producto al carrito de esta compra) plus the negative/zero quantity semantics. It does not explicitly distinguish itself from the sibling ver_carrito, which an agent might reasonably confuse with inspecting the cart, so it falls short of full sibling differentiation.

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?

Gives explicit sequencing rules: omit 'carrito' on the first call, always pass the returned token afterwards, and use crear_pedido with that token to close. It lacks an explicit 'do not use this to view the cart, use ver_carrito' exclusion, but the when-to-use context is clear.

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