Skip to main content
Glama

add_to_cart

Idempotent

Storefront, changes this session's cart only: adds one billing variant. Returns the updated cart (items, subtotal). Required: product_id of a variant, e.g. coil-scanner-monthly or coil-live-yearly; a bare family id returns an Unavailable error that lists its variants, and an unknown id returns a NotOffered error. Quantity is always 1 (one licence per person), so adding a variant already in the cart changes nothing. A product that is sold elsewhere cannot be added; the error carries its subscribe link. Needs an MCP session: without one nothing is stored. Takes no payment. Fits when the buyer has chosen a plan.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "product_id": "<product_id>"
    },
    "name": "add_to_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
quantityNoOptional and ignored: the quantity is always 1, one licence per person.
product_idYesA billing-variant id, e.g. coil-scanner-monthly or coil-live-yearly.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / product_id / description
      Added value: +"A billing-variant id, e.g. coil-scanner-monthly or coil-live-yearly."
    • addedInput schema / properties / quantity / description
      Added value: +"Optional and ignored: the quantity is always 1, one licence per person."
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: session-only persistence ("without one nothing is stored"), no payment taken, quantity fixed at 1 so re-adding is a no-op, per-error semantics (Unavailable lists variants, NotOffered for unknown ids, subscribe link for elsewhere-sold products), and the returned fields. These details match the idempotentHint/destructiveHint signals rather than contradicting them.

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?

Front-loads scope and effect, then return shape, then parameter rules, then error behavior, then preconditions. Dense but nearly every clause adds a fact; the slight cost is a run-on feel in the middle sentences that makes it harder to skim.

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?

With no output schema and no complex nesting, the description supplies the return fields, the error taxonomy, the session prerequisite, and the no-payment guarantee. An agent has everything needed to call it and to interpret failure modes.

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% and the schema already explains both fields, but the description adds meaning the schema cannot: variant ids versus bare family ids, the distinct errors each produces, and the fact that quantity is accepted but ignored. That is genuine semantic value on top of the structured data.

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 ("adds one billing variant" to "this session's cart") and scopes it to the storefront and to session state, so the agent knows exactly what changes and what does not. That distinguishes it from the sibling cart tools without needing their schemas.

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?

"Fits when the buyer has chosen a plan" plus "the buyer has chosen a plan" framing gives a clear positive-usage condition, and "A product that is sold elsewhere cannot be added" provides an exclusion. It does not name or route to siblings such as remove_from_cart or get_cart, so it stops short of explicit alternative selection.

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