Skip to main content
Glama

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.

Input Schema

NameRequiredDescriptionDefault
cart_idYescart_id returned by create_cart.

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: +"cart_id returned by create_cart."
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "cart_id": {
      +      "type": "string"
      +    },
      +    "created_at": {
      +      "type": "string"
      +    },
      +    "currency": {
      +      "const": "ZAR",
      +      "type": "string"
      +    },
      +    "customer": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": true,
      +          "properties": {
      +            "address": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "city": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "email": {
      +              "type": "string"
      +            },
      +            "name": {
      +              "type": "string"
      +            },
      +            "phone": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            }
      +          },
      +          "required": [],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "expires_at": {
      +      "type": "string"
      +    },
      +    "item_count": {
      +      "type": "number"
      +    },
      +    "items": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "colour": {
      +            "type": "string"
      +          },
      +          "finish": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "height_mm": {
      +            "type": "number"
      +          },
      +          "mount_type": {
      +            "type": "string"
      +          },
      +          "product_id": {
      +            "type": "string"
      +          },
      +          "product_name": {
      +            "type": "string"
      +          },
      +          "quantity": {
      +            "type": "number"
      +          },
      +          "total_price_zar": {
      +            "type": "number"
      +          },
      +          "unit_price_zar": {
      +            "type": "number"
      +          },
      +          "width_mm": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "product_id",
      +          "width_mm",
      +          "height_mm",
      +          "quantity",
      +          "unit_price_zar",
      +          "total_price_zar"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "total_zar": {
      +      "type": "number"
      +    },
      +    "updated_at": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "cart_id",
      +    "items",
      +    "item_count",
      +    "total_zar",
      +    "currency",
      +    "customer",
      +    "created_at",
      +    "updated_at",
      +    "expires_at"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, and the description adds genuinely new context: totals are in ZAR and the cart expires after 24 hours of inactivity, which affects how an agent should handle stale cart_ids. The itemized return contents partly duplicate the output schema, so it falls just short of a 5.

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 with zero filler: what it returns first, then when to call it, then the expiry caveat. Front-loaded and every sentence earns its place.

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 one fully documented parameter, a readOnlyHint annotation, and an existing output schema, the description only needed to add workflow sequencing and lifecycle behavior, both of which it provides. Nothing an agent needs to call it correctly is missing.

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 description coverage is 100% and the schema already explains that cart_id comes from create_cart. The description adds no further syntax or format detail, so the baseline 3 applies.

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 ('Retrieve live cart state by cart_id') and enumerates the returned content: item list, ZAR totals, stored customer details. This is clearly distinguishable from mutating siblings like update_cart and from get_checkout/get_order.

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?

Explicitly positions the call in the workflow: 'Call after update_cart to confirm changes are correct before proceeding to create_checkout.' It names the preceding and following sibling tools, so the agent knows both when to call it and what it gates.

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.