update_cart

Swiggy Instamart (Grocery): Update the cart with items. Replaces the entire cart. Signed-in users use selectedAddressId; guest users use latitude and longitude. Pass skuId, spinId, and quantity from search_products.

See update_cart in actionComing soon

Example

const result = await client.callTool({
  name: "update_cart",
  arguments: {
    items: [{ "spinId": "spin_42", "skuId": "sku_88", "quantity": 1 }],
    selectedAddressId: "...",
  },
});

Parameters

ParameterTypeRequiredDescription
selectedAddressIdstringnoSelected delivery address ID from get_addresses tool
latitudenumbernoGuest mode delivery latitude (-90 to 90).
longitudenumbernoGuest mode delivery longitude (-180 to 180).
itemsobject[]yesArray of items to add to cart

Session credentials (user identity, access token) are supplied automatically by the authenticated MCP session - you do not pass them in the tool call. See Authenticate.

Response

All Swiggy MCP tools return:

{
  "success": true,
  "data": { /* tool-specific payload */ },
  "message": "optional human-readable message"
}

On failure:

{
  "success": false,
  "error": { "message": "description of what went wrong" }
}

See Error codes for the full catalogue.

Output schema

data: InstamartCart & {
  removedOutOfStockItems?: InstamartCartItem[];
  reducedQuantityItems?: Array<{
    spinId: string;
    itemName: string;
    requestedQuantity: number;
    cappedQuantity: number;
    reason?: string;
  }>;
}

The base cart shape is the same as get_cart.

Schema notes

  • spinId: Instamart product/SKU identifiers. Use returned SKU-level IDs from the selected product variation when updating an Instamart cart; product-level IDs identify the broader product family.
  • reducedQuantityItems: live availability fields. If an item is out of stock, unserviceable, or quantity-capped, show the returned reason/message and refresh before checkout.
  • Fields marked optional may be omitted depending on user state, cart/order state, and live Swiggy availability.
  • Use returned identifiers and enum values exactly as provided; do not invent fallback IDs, status values, payment methods, or timestamps.

Details

FieldValue
Nameupdate_cart
MCP ServerInstamart
EndpointPOST mcp.swiggy.com/im
StageCart
Behaviourmutating

Next in this journey →

Continue with get_cart.