Store
review_store_unit_switch
writeReview store unit switch
Show the merchant what a unit switch converts, and get the token that applies it.
Overview
Reports what switching the Store length and weight units would change before anything changes: how many rows and quantities will show converted, with examples as the merchant admin shows them before and after. It returns a review_token, valid for 15 minutes and only for this connection, that switch_store_units needs. Nothing in the Store changes. Show the examples to the merchant before switching. It requires the store:write scope and is safe to repeat.
Permission
Requires thestore:writepermission. A connection without it answersinsufficient_scopenaming the permission to approve.
Annotations
Prerequisites
- The current units from get_store.
- A merchant has connected this store and approved the store:write scope.
Side effects
- Issues a review token that expires after 15 minutes. No Store data changes.
Arguments
The length unit to switch to.
One of: cm, in
The weight unit to switch to.
One of: kg, lb
Result
The units before and after, the unit_revision the review read, the counts and examples of converted quantities, and the review_token with its expiry.
The Store unit revision the review read. Send it to switch_store_units.
How many rows hold at least one quantity that will show converted.
How many quantities will show converted.
Some of the quantities that will show converted, before and after. Empty when nothing converts.
The opaque token switch_store_units needs. Do not parse it. It is valid only for this connection.
When review_token stops being valid, in ISO 8601 UTC.
Error cases
The connection was approved without store:write. Ask the merchant to reconnect and approve it, or to remove the connector and add it again if the approval screen does not offer it.
Review a switch to metric
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "review_store_unit_switch",
"arguments": {
"measurement_unit": "cm",
"weight_unit": "kg"
}
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"structuredContent": {
"request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t",
"store": {
"id": 12,
"name": "Demo Signs"
},
"from_measurement_unit": "in",
"from_weight_unit": "lb",
"to_measurement_unit": "cm",
"to_weight_unit": "kg",
"unit_revision": 7,
"converted_rows": 12,
"converted_quantities": 31,
"examples": [],
"review_token": "eyJpdiI6Ik1hY2hpbmVSZXZpZXdUb2tlbiJ9",
"expires_at": "2026-11-16T00:15:00Z"
}
}
}The connection was not granted store:write (error)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "review_store_unit_switch",
"arguments": {
"measurement_unit": "cm",
"weight_unit": "kg"
}
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"isError": true,
"structuredContent": {
"error": {
"code": "insufficient_scope",
"title": "Insufficient scope",
"detail": "The tool [review_store_unit_switch] requires the store:write scope, which this connection was not granted.",
"recovery": "The connection was authorised without the scope this tool needs. Ask the merchant to reconnect the Sign Customiser connector and approve the scope named in required_scopes. If the approval screen does not offer that permission, ask them to remove the connector from this AI agent and add it again. Do not retry this call.",
"required_scopes": [
"store:write"
],
"granted_scopes": [
"store:read"
]
}
}
}
}