Skip to main content
Glama

add_to_cart

Add a product to a Yandex Lavka cart without charging, incrementing quantity if it is already there. Check cart warnings and remove unavailable items before checkout.

Instructions

Add a product to the cart (increments if already present). No charge.

product_id is the id from a search result. Pass price from the same search result when available (Lavka validates it on cart writes).

IMPORTANT: search can return items that are only stocked in «Большая Лавка» (a different store) — they add fine but can't be ordered from the current one. After adding, check the returned cart's warning and each item's unavailable_on_depot; drop any flagged item with update_cart_item(id, 0).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
priceNo
quantityNo
product_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.5

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses increment-on-duplicate semantics, that no charge occurs, that price is server-validated on write, and a real cross-store stocking hazard with the exact fields (cart warning, item.unavailable_on_depot) to inspect afterward.

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 and the no-charge fact, then layers parameter notes and the depot warning in scannable paragraphs. Slightly verbose, but every section carries actionable content.

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?

An output schema exists, so return-shape detail isn't required, yet the description still tells the agent exactly which returned fields to check. Combined with the mutation semantics and store-availability caveat, it covers everything needed to invoke and recover from this cart write.

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 0%, so the description must compensate; it explains product_id's provenance (the id from a search result) and price's origin and validation, which adds real meaning. Quantity is left undocumented, so it does not fully cover all three parameters.

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+resource ('Add a product to the cart') plus a non-obvious behavioral qualifier ('increments if already present', 'No charge'), which distinguishes it from sibling update_cart_item that overwrites/removes items.

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?

Explicitly routes to the sibling alternative ('drop any flagged item with update_cart_item(id, 0)') and says when to pass price. It implies but does not state the prerequisite flow (search_products -> add_to_cart -> view_cart), so it falls just short of full when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.