Skip to main content
Glama

Перезапись корзины

grocery_set_cart

Set grocery cart contents exactly by specifying item counts, update or remove items, or clear the entire cart. Overwrites the whole cart and returns the final contents, enabling verification.

Instructions

Изменить или убрать товары в корзине. Считает количества АБСОЛЮТНО, в отличие от grocery_add_to_cart, который прибавляет.

items = JSON [{"id": "123", "count": 2}, ...]: count > 0 — сделать ровно столько (не прибавить); count = 0 — убрать товар из корзины; товары, которых нет в списке, остаются как были. clear=True — очистить корзину целиком, items тогда не нужен.

Отдельного эндпоинта удаления у банка нет: корзина всегда перезаписывается целиком, поэтому тул сам дочитывает текущий состав и шлёт полный список. Возвращает содержимое корзины ПОСЛЕ изменения — сверь его с ожидаемым.

Количество выше остатка (countAvailable) тул НЕ принимает: отвечает CART_QUANTITY_CONFLICT с перечнем SKU и не пишет корзину. Молчаливого clamp'а до остатка нет — уменьшить или заменить решает пользователь.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clearNo
itemsNo[]
app_idNo
point_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description adds substantial behavioral detail beyond annotations: absolute quantity semantics, full-cart rewrite behavior, countAvailable rejection with CART_QUANTITY_CONFLICT, no silent clamping, and the post-change cart return value. No contradiction with annotations is present.

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?

The description is compact for its complexity, well-structured with line breaks, and each sentence adds functional value. It front-loads the key distinction from grocery_add_to_cart and does not repeat schema fields.

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?

Given the output schema exists, return-value description is optional, but the tool still explains the post-change contents. Error behavior, full-rewrite mechanics, absolute semantics, and parameter semantics are all covered, making this complete for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has no parameter descriptions, but the description compensates well: items gets a JSON structure with count>0, count=0, and omitted-item semantics, and clear gets an explanation. app_id and point_id are not individually explained but are clear identifiers and optional with defaults.

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 clearly states the tool's action: modify or remove cart items by overwriting quantities. It explicitly distinguishes itself from grocery_add_to_cart, which increments quantities, so an agent can tell it apart without opening the 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?

The description explains exactly when to use this tool vs grocery_add_to_cart, how count=0 removes items, how items omitted stay untouched, and how clear=True empties the cart. It also clarifies that there is no dedicated delete endpoint, so the tool must rewrite the whole cart.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/icyberdeveloper/tbank-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server