Skip to main content
Glama

add_items_to_cart

Add items to a cart (creates one if missing) with customizations via nested options. Handles required-option failures by prompting user for choices.

Instructions

Add items to a cart (creates one if no cart_uuid passed and none open at the store). APPEND semantics: re-adding an item_id SUMS quantities. Items need item_id + item_name + quantity; customizations go in nested_options[] (entries: id, name, quantity, optional recursive options[]). On required-options failure the response lists required_options[] — ask the user to choose, then retry. Check list_carts first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesItems to add, e.g. [{"item_id":"123","item_name":"Salad","quantity":1,"nested_options":[{"id":"456","name":"Ranch","quantity":1}]}]
intentYesOne short line stating who this is for and the goal, e.g. 'Help the user order dinner'. DO NOT include the user's verbatim words, dietary/health/religious details, budgets, names, or other personal specifics — a generic goal is expected.
menu_idYesMenu ID from get_menu (restaurants) or build_grocery_list/item details (grocery)
store_idYesStore ID the items belong to
cart_uuidNoExisting cart to append to (omit to create/append to store's open cart). For someone else's group cart: pass their cart_uuid to join as a participant.
group_cartNoCreate a shareable GROUP cart (no cart_uuid), or join another person's group cart (with their cart_uuid). Response carries group_cart_url — share it with participants.
fulfillmentNoMode for a NEW cart (default delivery)
spend_limit_centsNoPer-participant spend limit in CENTS for a NEW host-pays group cart (2500 = $25). Requires group_cart; cannot combine with cart_uuid. Omit for unlimited.
Behavior4/5

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

Annotations indicate non-readonly, non-destructive, and open-world. Description adds APPEND semantics, error handling for required options, and group cart features. No contradiction.

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?

Packed with information in a structured flow: core action, specifics, error handling, then predecessor tool. Slightly verbose but every sentence adds value.

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?

No output schema, but description mentions response includes required_options[] and group_cart_url. Lacks other return fields like cart totals or status. Adequate but not fully complete.

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 100% but description adds context: intent guidelines (no personal details), group_cart behavior, spend_limit_cents explanation, and fulfillment default. Enriches parameter understanding.

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?

Clearly states the tool adds items to a cart, with APPEND semantics that sum quantities. Distinguishes from siblings like 'list_carts' (pre-check), 'show_cart' (view), and 'remove_cart_item' (remove).

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?

Advises checking 'list_carts' first, retrying on required_options failure, and asking user to choose. Explains when to use cart_uuid vs create. Does not explicitly list when not to use, but context is clear.

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/CydVilla/peckish'

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