Skip to main content
Glama

SendaMeal Storefront

add_item_to_cart

Add one or more items to the shopping cart.

If no cart exists, this tool makes a new cart. This tool adds products and gift certificates.

Steps

  1. Call the 'search_products' tool to find a product.

  2. Call the 'get_product_details' tool to get the variants and the modifier options.

  3. Call this tool to add the item.

  4. Call the 'create_checkout_url' tool to get a checkout URL.

Rules

Send 'quantity' and 'productEntityId' for each item. If the product has variants, send 'variantEntityId'.

Modifier options

A modifier option is a product choice that is not a variant. Examples are an engraving message and a nicotine strength. The 'get_product_details' tool returns these options in 'modifierOptions'.

If the product has no 'modifierOptions', do not send 'selectedOptions'. Do not send a variant option in 'selectedOptions'. Send a variant in 'variantEntityId'.

An option is required if 'isRequired' is 'true'. Send each required option. If you do not send a required option, the server does not add the item.

To send an option:

  1. Read the bucket name from 'selectedOptionsKey'.

  2. Add the option to 'item.selectedOptions' in that bucket.

  3. Send the 'optionEntityId' of the option.

  4. For a choice option, send the 'valueEntityId' of the value that the user selected.

Send only the buckets that you need.

Example. A required choice option has a 'selectedOptionsKey' of "multipleChoices", an 'optionEntityId' of 108, and a selected value with a 'valueEntityId' of 251: { "item": { "quantity": 1, "productEntityId": 88, "variantEntityId": 67, "selectedOptions": { "multipleChoices": [ { "optionEntityId": 108, "optionValueEntityId": 251 } ] } } }

A free-entry bucket takes a typed value in place of an ID. 'textFields' and 'multiLineTextFields' take "text". 'numberFields' takes "number". 'dateFields' takes "date". Obey the 'constraints' of the option.

If a required option has more than one value, ask the user to select one value. Do not select a value yourself. Do not use the default value.

If 'unsupported' is 'true', you cannot send the option. If such an option is also required, tell the user to buy the product on the website.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cartYes
messageNo
successYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / item / properties / selectedOptions / required
      Removed value: -[
      -  "checkboxes",
      -  "dateFields",
      -  "multiLineTextFields",
      -  "multipleChoices",
      -  "numberFields",
      -  "textFields"
      -]
    • changedInput schema / properties / item / required
      Previous value: -[
      -  "quantity",
      -  "productEntityId",
      -  "variantEntityId",
      -  "selectedOptions"
      -]New value: +[
      +  "quantity",
      +  "productEntityId",
      +  "variantEntityId"
      +]
  2. First observed

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description fully carries the burden of behavioral disclosureaine it explains side effects (creates a new cart if none exists), prerequisites (must call search_products and get_product_details first), and failure modes (server does not add item if required option is missing, user must buy on website if unsupported and required). It also clarifies that default values should not be used, which is important behavioral guidance.

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 lengthy but extremely structured, using numbered steps and bullet lists to break down complex logic. It front-loads the core purpose and steps, then details modifier options and rules. Every sentence serves a purpose; there is no filler. The example is provided to clarify the expected JSON format, which is necessary for a complex schema. The length is justified given the complexity of the tool.

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?

Despite the complexity of the tool (nested objects, multiple option types, constraints) and the absence of annotations, the description covers all necessary aspects: pre-conditions, usage steps, parameter semantics, failure handling, and interaction with other tools. The output schema exists, so return value details are not needed. The description is comprehensive enough for an agent to correctly invoke the tool in various scenarios.

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 descriptions (0% coverage), so the description must add meaning to parameters. It explains the purpose of each key: 'quantity' and 'productEntityId' for every item, 'variantEntityId' for variants, and 'selectedOptions' for modifier options. It details the structure of selectedOptions, mapping bucket names to value types (text, number, date, IDs) and clarifies the distinction between variants and options, which is critical for correct invocation.

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 function: adding one or more items to the shopping cart, including products and gift certificates, and creating a cart if necessary. It distinguishes itself from siblings by explicitly listing a workflow with preceding steps (search_products, get_product_details) and succeeding steps (create_checkout_url), making its role in the broader process unambiguous.

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 provides extensive usage guidance: it outlines a step-by-step procedure (search, get details, add, checkout), specifies rules for mandatory fields (quantity, productEntityId, variantEntityId when variants exist), details when to omit selectedOptions (when no modifierOptions exist), and instructs to ask the user for multi-value required options instead of selecting default values. It also covers error handling for unsupported required options.

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