Skip to main content
Glama

Remove a cart line

order_remove_line
DestructiveIdempotent

Remove a line from the session cart, returning the remaining cart.

Call it when the customer asks to drop the line: their request is the go-ahead, and the line is removed on this call. LineNotFoundError means no line has that line_id.

A line that is already an item of an unpaid order is removed from that order too: the order keeps its id, its reference and its other items, and a payment link already sent for it stops working, so ask for a new one. OrderEditRefusedError means RendReal refused: the order was just paid or is in production, and the line stays. LastOrderItemError means the line is its order's only item: ask the customer whether to cancel the order instead. LineLockedError means the line's order is paid or its status cannot be read, and nothing changed.

Returns a job — poll until SUCCEEDED for the remaining cart.

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": {
      "session_id": "<session_id>",
      "line_id": "<line_id>"
    },
    "name": "order_remove_line"
  }
}

Input Schema

NameRequiredDescriptionDefault
line_idYes
session_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / result / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "lines": {
      -        "items": {
      -          "properties": {
      -            "in_checkout": {
      -              "default": false,
      -              "description": "True when this line is already in this session's checkout, set up by the artwork upload page or a payment link; it is not added again.",
      -              "type": "boolean"
      -            },
      -            "line_id": {
      -              "type": "string"
      -            },
      -            "needs_quote": {
      -              "type": "boolean"
      -            },
      -            "offers": {
      -              "items": {
      -                "properties": {
      -                  "amount": {
      -                    "type": "number"
      -                  },
      -                  "currency": {
      -                    "type": "string"
      -                  },
      -                  "offer_id": {
      -                    "type": "string"
      -                  },
      -                  "price_scope": {
      -                    "default": "excludes_shipping_and_tax",
      -                    "description": "This amount is the print price; shipping and tax are added at checkout.",
      -                    "enum": [
      -                      "excludes_shipping_and_tax"
      -                    ],
      -                    "type": "string"
      -                  },
      -                  "production_days": {
      -                    "minimum": 0,
      -                    "type": "integer"
      -                  }
      -                },
      -                "required": [
      -                  "offer_id",
      -                  "amount",
      -                  "currency",
      -                  "production_days"
      -                ],
      -                "type": "object"
      -              },
      -              "type": "array"
      -            },
      -            "order_outcome_unknown": {
      -              "default": false,
      -              "description": "True when the request to place this line got no clear answer, so it may be placed already and is not sent again.",
      -              "type": "boolean"
      -            },
      -            "product_name": {
      -              "type": "string"
      -            },
      -            "sku": {
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "line_id",
      -            "sku",
      -            "product_name",
      -            "needs_quote",
      -            "offers"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "lines"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "description": "Canonical short-circuit response shape.\n\n`status` is always `\"error\"` — acts as a discriminator for LLM consumers.\n`error` is a machine-readable code (e.g. `session_not_found`).\n`reason` is a human-readable explanation of why the call failed.\n`detail` carries structured extra context (ids, available values, etc.).",
      -    "properties": {
      -      "detail": {
      -        "anyOf": [
      -          {},
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "error": {
      -        "type": "string"
      -      },
      -      "reason": {
      -        "type": "string"
      -      },
      -      "status": {
      -        "const": "error",
      -        "default": "error",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "error",
      -      "reason"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "description": "The Runner's response to a `@runner.job` invocation.\n\nOn the fast path (work completed within budget), `status` is SUCCEEDED\nor FAILED and `result` / `error` is populated. On the slow path,\n`status` is RUNNING and `job_id` is the handle the host LLM uses for\n`poll()`.\n\nOn FAILED, `error` is the safe class-name code; `reason` / `detail` are\npopulated only when the failure carries a host-safe explanation (e.g. a\nRendReal rejection's server message + body), else they stay None.\n\nOn RUNNING, `note` carries model-facing guidance: it tells the host LLM whether\na widget is already polling the job, or whether it must call `poll_job` itself.",
      +    "properties": {
      +      "detail": {
      +        "anyOf": [
      +          {},
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "error": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "job_id": {
      +        "type": "string"
      +      },
      +      "note": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "reason": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "result": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": {},
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "status": {
      +        "enum": [
      +          "PENDING",
      +          "RUNNING",
      +          "SUCCEEDED",
      +          "FAILED"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "job_id",
      +      "status"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "Canonical short-circuit response shape.\n\n`status` is always `\"error\"` — acts as a discriminator for LLM consumers.\n`error` is a machine-readable code (e.g. `session_not_found`).\n`reason` is a human-readable explanation of why the call failed.\n`detail` carries structured extra context (ids, available values, etc.).",
      +    "properties": {
      +      "detail": {
      +        "anyOf": [
      +          {},
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "error": {
      +        "type": "string"
      +      },
      +      "reason": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "const": "error",
      +        "default": "error",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "error",
      +      "reason"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed1 schema field changed
    • changedOutput schema / properties / result / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "lines": {
      -        "items": {
      -          "properties": {
      -            "already_ordered": {
      -              "default": false,
      -              "description": "True when this line was already ordered in this session; order_create refuses to buy it again.",
      -              "type": "boolean"
      -            },
      -            "line_id": {
      -              "type": "string"
      -            },
      -            "needs_quote": {
      -              "type": "boolean"
      -            },
      -            "offers": {
      -              "items": {
      -                "properties": {
      -                  "amount": {
      -                    "type": "number"
      -                  },
      -                  "currency": {
      -                    "type": "string"
      -                  },
      -                  "offer_id": {
      -                    "type": "string"
      -                  },
      -                  "price_scope": {
      -                    "default": "excludes_shipping_and_tax",
      -                    "description": "This amount is the print price; shipping and tax are added at checkout.",
      -                    "enum": [
      -                      "excludes_shipping_and_tax"
      -                    ],
      -                    "type": "string"
      -                  },
      -                  "production_days": {
      -                    "minimum": 0,
      -                    "type": "integer"
      -                  }
      -                },
      -                "required": [
      -                  "offer_id",
      -                  "amount",
      -                  "currency",
      -                  "production_days"
      -                ],
      -                "type": "object"
      -              },
      -              "type": "array"
      -            },
      -            "order_outcome_unknown": {
      -              "default": false,
      -              "description": "True when the order request for this line got no clear answer, so an order may exist that order_create will not send again.",
      -              "type": "boolean"
      -            },
      -            "product_name": {
      -              "type": "string"
      -            },
      -            "sku": {
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "line_id",
      -            "sku",
      -            "product_name",
      -            "needs_quote",
      -            "offers"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "lines"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "description": "Canonical short-circuit response shape.\n\n`status` is always `\"error\"` — acts as a discriminator for LLM consumers.\n`error` is a machine-readable code (e.g. `session_not_found`).\n`reason` is a human-readable explanation of why the call failed.\n`detail` carries structured extra context (ids, available values, etc.).",
      -    "properties": {
      -      "detail": {
      -        "anyOf": [
      -          {},
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "error": {
      -        "type": "string"
      -      },
      -      "reason": {
      -        "type": "string"
      -      },
      -      "status": {
      -        "const": "error",
      -        "default": "error",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "error",
      -      "reason"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "lines": {
      +        "items": {
      +          "properties": {
      +            "in_checkout": {
      +              "default": false,
      +              "description": "True when this line is already in this session's checkout, set up by the artwork upload page or a payment link; it is not added again.",
      +              "type": "boolean"
      +            },
      +            "line_id": {
      +              "type": "string"
      +            },
      +            "needs_quote": {
      +              "type": "boolean"
      +            },
      +            "offers": {
      +              "items": {
      +                "properties": {
      +                  "amount": {
      +                    "type": "number"
      +                  },
      +                  "currency": {
      +                    "type": "string"
      +                  },
      +                  "offer_id": {
      +                    "type": "string"
      +                  },
      +                  "price_scope": {
      +                    "default": "excludes_shipping_and_tax",
      +                    "description": "This amount is the print price; shipping and tax are added at checkout.",
      +                    "enum": [
      +                      "excludes_shipping_and_tax"
      +                    ],
      +                    "type": "string"
      +                  },
      +                  "production_days": {
      +                    "minimum": 0,
      +                    "type": "integer"
      +                  }
      +                },
      +                "required": [
      +                  "offer_id",
      +                  "amount",
      +                  "currency",
      +                  "production_days"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "order_outcome_unknown": {
      +              "default": false,
      +              "description": "True when the request to place this line got no clear answer, so it may be placed already and is not sent again.",
      +              "type": "boolean"
      +            },
      +            "product_name": {
      +              "type": "string"
      +            },
      +            "sku": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "line_id",
      +            "sku",
      +            "product_name",
      +            "needs_quote",
      +            "offers"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "lines"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "Canonical short-circuit response shape.\n\n`status` is always `\"error\"` — acts as a discriminator for LLM consumers.\n`error` is a machine-readable code (e.g. `session_not_found`).\n`reason` is a human-readable explanation of why the call failed.\n`detail` carries structured extra context (ids, available values, etc.).",
      +    "properties": {
      +      "detail": {
      +        "anyOf": [
      +          {},
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "error": {
      +        "type": "string"
      +      },
      +      "reason": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "const": "error",
      +        "default": "error",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "error",
      +      "reason"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds substantial context the annotations cannot convey: the cross-order side effect on unpaid orders, that the order keeps its id/reference/other items, that an already-sent payment link stops working and must be reissued, and that the call returns a job to poll. It also maps four named errors (LineNotFoundError, OrderEditRefusedError, LastOrderItemError, LineLockedError) to what actually changed or stayed in place.

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-loaded with the action and the when-to-use rule, then the side effects and error semantics in compact order. The error-mapping sentences are dense but each earns its place; a few phrasings ("their request is the go-ahead") could be tightened without losing meaning.

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?

For a destructive mutation with real cross-entity consequences, the description covers authorization, side effects, failure modes, and the asynchronous job contract (poll until SUCCEEDED), and an output schema exists so return shape need not be spelled out. The remaining hole is session_id semantics and whether a removal can be undone.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for two required parameters, so the description must carry the meaning. It only clarifies line_id indirectly via "no line has that line_id" and leaves session_id unexamined — whether it identifies the cart, a conversation, or a customer session is never stated, nor is any format guidance.

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 ("Remove a line from the session cart") plus the result ("returning the remaining cart"), which separates it cleanly from siblings like order_view_cart, order_cancel, and order_create. An agent can identify the operation 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?

Gives a concrete trigger ("when the customer asks to drop the line") and clarifies that the customer's request itself is the authorization, removing an ambiguity an agent would otherwise hesitate on. The only gap is that alternatives such as cancelling the order are surfaced only inside an error branch (LastOrderItemError) rather than stated upfront.

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