Skip to main content
Glama

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

grocery_set_cart

Set exact item quantities in the grocery cart, remove items by setting count to 0, or clear the cart entirely; returns the updated cart for verification.

Instructions

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

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

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

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "grocery_set_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
clearNo
itemsNo[]
app_idNo
point_idNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, openWorldHint=true, destructiveHint=false) by disclosing that the bank has no separate delete endpoint, that the tool itself re-reads the current cart and submits a full replacement list, and that the response reflects the cart AFTER the change for verification. The removal and full-clear semantics are spelled out explicitly, which matters because destructiveHint=false alone would not tell an agent that items can disappear.

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?

Front-loads the core semantics (absolute counts, contrast with the additive sibling) before the item-format detail, then closes with the endpoint quirk and the return value. The indented items spec is compact and every line carries information an agent needs to call the tool correctly.

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 mutation tool with an output schema and no required parameters, the description covers mode selection, item syntax, the internal read-modify-write behavior, and return semantics. The remaining gap is the undocumented app_id/point_id context parameters, which an agent may need to supply without any hint about what they identify.

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

Parameters3/5

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

Schema description coverage is 0% and the schema gives only bare types/defaults, so the description must compensate. It does so thoroughly for items (JSON shape, count>0 sets exactly, count=0 removes, unlisted items untouched) and for clear, but app_id and point_id are never mentioned anywhere, leaving half the parameters undefined.

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 ('Изменить или убрать товары в корзине') and immediately distinguishes it from the sibling grocery_add_to_cart by contrast ('Считает количества АБСОЛЮТНО, в отличие от ... который прибавляет'). An agent can pick between the two without opening either schema.

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 an explicit when-to-use rule (absolute set vs additive add) and enumerates the two operating modes: per-item counts, with count=0 meaning removal, and clear=True for a full wipe. It does not mention reading the cart first via the grocery_cart sibling, and does not clarify whether clear=True and an empty items list are equivalent, so the guidance is strong but not exhaustive.

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