Skip to main content
Glama

View a cart

get_cart
Read-only

Retrieve live cart state by cart_id: full item list, calculated totals in ZAR, and any customer details stored so far. Call after update_cart to confirm changes are correct before proceeding to create_checkout. Cart expires after 24 hours of inactivity.

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": {
      "cart_id": "<cart_id>"
    },
    "name": "get_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
cart_idYesId of the cart, as returned when the cart was created. Carts expire after 24 hours without changes

Output Schema

NameRequiredDescriptionDefault
itemsYes
cart_idYes
currencyYes
customerYes
total_zarYes
created_atYes
expires_atYes
item_countYes
updated_atYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / cart_id / description
      Added value: +"Id of the cart, as returned when the cart was created. Carts expire after 24 hours without changes"
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare a read-only, non-destructive, closed-world read, so safety needs no restating. The description adds genuinely useful behavior beyond them: the payload scope (items, ZAR totals, stored customer data) and the 24-hour inactivity expiry, which affects retry logic.

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?

Three short sentences: what it returns, when to call it, and its expiry constraint. The key retrieval purpose leads, and every sentence carries distinct information with no repetition.

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?

With an output schema, the description need not detail return values, and it still summarizes them helpfully alongside the expiry and sequencing rules. The only gap is the consequence of calling with an expired cart_id (error vs. empty cart), a minor omission for a single-param read.

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 coverage is 100% and the single cart_id parameter is fully documented there, including the same 24-hour expiry note. The description adds no format, syntax, or lookup semantics beyond the schema, so the baseline of 3 applies.

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 opens with a specific verb and resource ('Retrieve live cart state by cart_id') and enumerates what comes back (items, ZAR totals, customer details). It positions the tool relative to update_cart and create_checkout, so an agent can place it in the cart lifecycle without opening the 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?

It gives explicit sequencing guidance: call after update_cart to verify changes, then move to create_checkout. It does not say when not to use it (e.g., use get_checkout once a checkout exists), but the positive routing context is clear.

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