Skip to main content
Glama

discounts__calculate_order_loyalty

Read-only

Calculate applicable discounts and loyalty rewards for an order using items, phone, coupon, and manual conditions before placing the order.

Instructions

Расчёт скидок/лояльности заказа (короткая форма calculate).

items собираются через build_product_item / build_compound_item. Купон и ручные условия передаются через order.loyalty_info (верхнеуровневые поля request — obsolete). Где взять ID: comboGroupId → menu__get_combos_info; comboId → menu__get_combos_info; comboSourceId → menu__get_combos_info; productSizeId → menu__get_nomenclature. Это тул-обёртка: своего троттлинга нет, но вызов расходует квоту нижележащего метода API — кэшируйте результат в диалоге.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
phoneYes
couponNo
customerNo
organization_idYes
terminal_group_idNo
order_service_typeNo
applicable_manual_conditionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Beyond the readOnlyHint and destructiveHint annotations, the description adds valuable behavioral context: it is a tool wrapper with no throttling, consumes quota of the underlying API method, and recommends caching the result in the dialog. It also flags that top-level request fields are obsolete, directing to order.loyalty_info. No contradiction with annotations.

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?

The description is compact and front-loaded with the primary purpose, followed by practical usage notes and caching advice. It is not overly verbose, though the obsolete-fields note ('верхнеуровневые поля request — obsolete') is somewhat convoluted and could be clearer.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the schema has 0% coverage and no output schema, the description provides helpful guidance on item construction and ID sourcing, but leaves several parameters unexplained and does not describe the return value or expected output. The ambiguity around order.loyalty_info and the obsolete top-level fields makes the definition incomplete for an agent to call the tool with full confidence.

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?

With 0% schema description coverage, the description compensates somewhat by explaining how to build items and where to obtain combo/nomenclature IDs. However, it references order.loyalty_info which does not appear in the provided schema, creating ambiguity about whether to use top-level fields or a nested structure. Several parameters (phone, organization_id, terminal_group_id, etc.) remain unexplained.

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?

The description clearly states the tool calculates discounts/loyalty for an order ('Расчёт скидок/лояльности заказа'), which is a specific verb+resource. It aligns with the tool name and distinguishes from sibling calculate_loyalty_checkin by focusing on 'order', though it does not explicitly name the alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides practical guidance on constructing items (via build_product_item / build_compound_item), where to find IDs (menu__get_combos_info, menu__get_nomenclature), and advises caching results. However, it does not explicitly state when to use this tool versus sibling alternatives, nor does it give exclusion criteria.

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

Deploy Server

Other Tools