Sign Customiser

Navigation

Dark mode

Store

review_store_unit_switch

write

Review store unit switch

Copy page

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

readOnlyHintfalse
destructiveHintfalse
idempotentHinttrue
openWorldHintfalse

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

measurement_unitstringrequired

The length unit to switch to.

One of: cm, in

weight_unitstringrequired

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.

request_idstringalways present
storeobjectalways present
store.idintegeralways present
store.namestringalways present
from_measurement_unitstringalways present
from_weight_unitstringalways present
to_measurement_unitstringalways present
to_weight_unitstringalways present
unit_revisionintegeralways present

The Store unit revision the review read. Send it to switch_store_units.

converted_rowsintegeralways present

How many rows hold at least one quantity that will show converted.

converted_quantitiesintegeralways present

How many quantities will show converted.

examplesarray of objectalways present

Some of the quantities that will show converted, before and after. Empty when nothing converts.

review_tokenstringalways present

The opaque token switch_store_units needs. Do not parse it. It is valid only for this connection.

expires_atstringalways present

When review_token stops being valid, in ISO 8601 UTC.

Error cases

insufficient_scope

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

tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "review_store_unit_switch",
    "arguments": {
      "measurement_unit": "cm",
      "weight_unit": "kg"
    }
  }
}
result
{
  "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)

tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "review_store_unit_switch",
    "arguments": {
      "measurement_unit": "cm",
      "weight_unit": "kg"
    }
  }
}
result
{
  "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"
        ]
      }
    }
  }
}

Type a question and press Enter. Use the arrow keys to move between the results.