Skip to main content

select_alternative

Swaps an item in the cart for a different product. Used after get_alternatives to let the customer pick a replacement.

Platform Support

PlatformStatusNotes
iOSPlannediOS handles alternatives through remove + add flow
AndroidYesDefined in the app-context module
Authentication Required

The user must be signed in to use this tool.

Description

Replace a cart item with an alternative product

Parameters

NameTypeRequiredDefaultDescription
entry_guidstringYesCart entry GUID of the item to replace
alternative_codestringYesProduct code of the alternative to use instead

Response

FieldTypeDescription
successbooleanWhether the swap was successful
cart_totalstringUpdated cart total

Error Codes

CodeDescription
AUTH_REQUIREDUser must be signed in
INVALID_PARAMSMissing entry_guid or alternative_code

Source Files

  • Android: chat-pnp-android/mcp-app/src/main/java/pnp/app/mcp/app/tools/AppMCPTools.kt