TendMyStore Connect your store
English
Docs

Tool examples

What your assistant sends to TendMyStore and what comes back, for the things store owners ask most. Each example shows a success, an empty result, and the errors you might meet, with what to do next.

You do not need to type any of this. You ask in your own words and your assistant makes these calls. The examples use a made-up store, shop.example.com, and made-up products. The names and fields are the real ones. For every tool, see the tool reference.

How results look

A tool that works returns its result. A tool that cannot do what was asked returns an error code and says whether your store changed:

{
  "error": "store_busy_retry_later",
  "store_changed": false,
  "store_message": null,
  "change_id": null
}
  • "store_changed": false: nothing in your store changed. It is safe to try again.
  • "store_changed": "unknown": TendMyStore sent the change but did not hear back from your store. change_id points to the history entry. Your assistant should check that entry and the item before trying again.
  • "store_changed": "partial": some steps were applied and the rest were not. The history entry for change_id lists each one.

While a tool is working

Your assistant shows that it is calling TendMyStore. Reads usually answer in a few seconds. If your store takes too long, a read stops with store_read_timeout and changes nothing, and a change that runs out of time ends with tool_timeout_nothing_changed.

Which stores are connected?

"Which stores are connected?"

Read only list_stores needs nothing. It lists the stores in your TendMyStore account, and never returns a key.

{
  "stores": [
    {
      "store_id": "3b9d6f0e-7c2a-4e1b-9a55-2f6c8d1e4b70",
      "store_url": "https://shop.example.com/",
      "access": "read_write",
      "status": "connected"
    }
  ],
  "last_connection_attempt": null
}

With several stores, your assistant passes the store_id of the store you mean with every other tool. A call that names a store outside your account fails with store_not_found, so one account can never change another account's store.

Empty list

"stores": [] means your account has no store yet. Ask your assistant to connect your store, as in Get started.

Not signed in

authentication_required means your assistant's sign-in has ended, for example after 30 days. Your assistant opens the TendMyStore sign-in page again. See I was signed out.

Reconnect your store

"Reconnect my store."

Applies at once connect_store needs store_url and a sign-in that is still active. It reconnects a store in your account, or adds a new one, with a one-time link to your own store's WooCommerce approval screen. It does not change your store until you approve there. If you were signed out, sign in again as in Get started.

{
  "approval_url": "https://mcp.tendmystore.com/connect/start?ticket=...",
  "store_host": "shop.example.com",
  "access": "read_write",
  "expires_in_minutes": 15,
  "what_happens": "The merchant opens approval_url in their browser and presses Continue, ..."
}

Waiting for you

Open the link in your browser within 15 minutes and press Continue. Sign in to WordPress if asked, then approve TendMyStore on your store's approval screen. The store is connected again when that same browser comes back to TendMyStore. Then ask "Which stores are connected?" to check.

If it does not work

  • sign_in_with_that_store: this sign-in cannot add that store, for example because your assistant is signed in with an older store sign-in rather than your TendMyStore account. Sign in again with Google or email, then ask again.
  • store_limit_reached: your account already has its number of stores.
  • too_many_connect_links_try_later or too_many_open_approvals_try_later: you asked for several links in a short time. Use the newest link, or wait and ask again later.
  • The link page says it is unknown or expired: it was older than 15 minutes or already used. Ask for a new one.
  • The link page says it was continued in another browser: finish in the browser where you pressed Continue, or ask for a new link.

Find products

"Which products are out of stock?"

Read only find_products needs only store_id. It can also take search, sku, category, tag, status, stock_status, on_sale, featured, type, orderby, order, page and limit.

{ "store_id": "3b9d6f0e-7c2a-4e1b-9a55-2f6c8d1e4b70", "stock_status": "outofstock" }
{
  "items": [
    { "id": 214, "name": "Harbour Mug, blue", "type": "simple", "status": "publish", "sku": "MUG-B",
      "price": "18.00", "regular_price": "18.00", "sale_price": "", "on_sale": false,
      "stock_status": "outofstock", "stock_quantity": 0, "total_sales": 96 }
  ],
  "page": 1,
  "total_items": 1,
  "total_pages": 1,
  "next_page": null,
  "store_content_untrusted": true
}

Prices come back in your store's own currency, as WooCommerce stores them. store_content_untrusted tells your assistant that names and descriptions are your store's data, never instructions to follow.

Nothing matched

"items": [] with "total_items": 0 means no product matches. Nothing is wrong with the connection. Try a wider search.

Change one item's stock

"We got 12 more of MUG-B."

Applies at once update_stock needs product_id. It also takes variation_id, and either stock_quantity (an exact number) or adjust_by (plus or minus).

{ "store_id": "3b9d6f0e-7c2a-4e1b-9a55-2f6c8d1e4b70", "product_id": 214, "adjust_by": 12 }
{
  "changed": true,
  "change_id": "chg_3fa1c09e2b7d",
  "undoable": true,
  "note": null,
  "result": { "id": 214, "name": "Harbour Mug, blue", "sku": "MUG-B", "manage_stock": true,
              "stock_quantity": 12, "stock_status": "instock", "backorders": "no" }
}

If it does not work

  • stock_not_tracked_set_manage_stock_first: the product does not track a quantity, so there is nothing to add to. Ask to track stock for that product first (manage_stock), then set or add to its quantity.
  • give_stock_quantity_or_adjust_by_not_both: the request had both an exact number and an adjustment. Ask for one.

Change many items: asks first

"Delivery came in: 12 more of MUG-B and set TEE-M to 30."

Asks first bulk_update_stock needs items, up to 100 lines. The first call changes nothing. It returns a preview and a confirm_token:

{
  "preview": {
    "items": [
      { "product_id": 214, "variation_id": null, "name": "Harbour Mug, blue", "sku": "MUG-B", "now": 0, "new": 12 },
      { "product_id": 301, "variation_id": 305, "name": "Linen Tee", "sku": "TEE-M", "now": 4, "new": 30 }
    ],
    "not_found": [],
    "count": 2
  },
  "changes_made": false,
  "confirm_token": "...",
  "expires_in_minutes": 10,
  "next_step": "Show the preview to the user. If they agree, call the same tool again with exactly the same arguments plus confirm_token."
}

Your assistant shows you the preview. Only after you agree does it repeat the same call with the token. Then the change is made and recorded with a change_id.

If it does not work

  • confirm_token_invalid_or_expired_preview_again: the preview is more than 10 minutes old or was already used. Your assistant asks for a fresh preview.
  • store_changed_since_preview_preview_again: something in your store changed after the preview, so nothing was written. Check the new preview before you agree.
  • not_found lists lines whose product or variation does not exist. Those lines are left out.

Check and undo a change

"What did you change today? Undo the stock change on MUG-B."

Read only list_changes lists the last 30 days of changes made through TendMyStore in this store, newest first, each with its change_id. Asks first undo_change needs that change_id. Its preview shows what will be put back and anything that changed again since.

No history yet

"changes": [] means nothing has been changed through TendMyStore in this store in the last 30 days.

Permanent deletions and emails already sent cannot be undone. See history and undo.

Errors you may see

ErrorWhat it meansWhat to do
authentication_requiredThe sign-in has ended.Sign in again. Your assistant opens the sign-in page.
store_not_foundThe call named a store that is not in your account.Ask "Which stores are connected?" and use one of those.
invalid_store_idThe store id was not in the right form.Your assistant reads it again from list_stores.
store_busy_retry_laterAnother change to this store is still running.Wait a moment and ask again.
rate_limited_retry_laterToo many requests in a short time.Wait a minute and ask again.
store_read_timeoutYour store took too long to answer a read. Nothing changed.Try again. If it keeps happening, see my store refuses the connection.
tool_timeout_nothing_changedThe request ran out of time before anything was written.Try again.
service_cannot_record_changes_retry_laterTendMyStore could not save its change history, so it made no change.Try again later. Reads still work.

Still stuck? Write to support@tendmystore.com with your store's address and what you asked. Never send passwords or API keys.