Skip to main content

AI Agents (Abilities API and MCP)

Google Automated Discounts can be fully operated by an AI agent. An agent such as Claude, Cursor or VS Code Copilot can walk you through the setup, change any setting, check whether discounts arrive and convert, look into discounted orders, set minimum prices, check whether a cache breaks the discount session, read the logs and run diagnostics.

Available Since

Version 1.7.1 of Google Automated Discounts. Since version 1.8.0 the plugin's admin screens are covered, and since version 1.10.1 also the caching check, the product minimum prices and the Automated Discounts info of orders.

The plugin registers its actions as abilities with the WordPress Abilities API. The WordPress MCP Adapter plugin makes them available to AI clients. To connect your AI client, follow the setup in AI Agents and MCP. This page explains what the agent can do with Google Automated Discounts once it is connected.

How It Works​

  • The agent has exactly your permissions. Every ability uses the same permission check as the admin page and the dashboard card: the agent's WordPress user needs the manage_woocommerce capability, which administrators and shop managers have. Setting a product's minimum price also requires that the user may edit that product.
  • Same validation as the admin. Every value goes through the same checks as the settings screen. Each setting reports back whether it was updated, unchanged, invalid with the reason, or unknown.
  • Every change is backed up. Before any settings change, the current settings are backed up. The last 10 backups are kept, and a restore is backed up too, so it can be undone as well.
  • A built-in setup guide. The plugin tells the agent which steps are done, which are still open, and which ability to call next with an example input. So the agent can guide you through the whole setup.

All abilities start with google-automated-discounts/.

Getting Started​

Once your AI client is connected, ask in plain language. A good first request:

Walk me through setting up Google Automated Discounts.

The agent reads google-automated-discounts/get-setup-guide, an ordered setup plan, and works through it step by step, asking you for anything only you know, such as your Google Merchant Center ID.

More examples of what you can ask:

  • "Is Google Automated Discounts ready to deliver discounts?"
  • "How many discounted clicks and orders did we get in the last 30 days?"
  • "Give me a test link so I can check that a discount shows up."
  • "Turn on the discount banner."
  • "Discounts disappear after the first page. Run the caching check and tell me how to fix it."
  • "Which orders from the last week were sold at a discounted price, and by how much?"
  • "Set the minimum price of the blue XL variation to 29 euros."
  • "Enable the calculated minimum price and regenerate all minimum prices."
  • "Get the debug report for SweetCode support."

Available Abilities​

Setup and Settings​

AbilityWhat it does
get-setup-guideOrdered setup plan: each step with its status, plain-language instructions, and which ability to call with an example input. The main entry point for a guided setup.
get-setup-statusHealth check: whether the plugin is ready to deliver discounts and which prerequisites are met (WooCommerce, license, transients, Merchant Center ID, test links).
get-settingsCurrent value of every setting, by dot-notation path such as discount_banner.is_active.
get-settings-schemaEvery writable setting with its type, default and allowed values.
update-settingsChanges one or more settings, for example {"settings": {"discount_banner.is_active": true}}.
set-merchant-center-idSets or clears the Google Merchant Center ID, the most important setup step.
list-settings-backupsLists the backups taken before each settings change, newest first.
restore-settings-backupRolls the settings back to a backup.

Performance and Testing​

AbilityWhat it does
get-statisticsDiscounted clicks and orders for the last 7 and 30 days, as shown on the Statistics tab.
get-click-logThe raw click and order log behind the statistics, like the CSV download. Contains customer IP addresses, so it is meant for troubleshooting.
get-testing-linksReady-to-open test links that simulate a Google discount, with the regular and discounted price.
reset-testing-linksDiscards the stored test links so fresh ones are generated.
run-caching-checkRuns the caching check of the Testing tab from the server: opens a product the way a shopper from a Google ad does and tells whether a page cache or CDN breaks the discount session. Returns a verdict, each finding with the fix, the response headers and a report for support.

Orders​

AbilityWhat it does
list-discount-ordersLists the orders placed in an Automated Discounts session, newest first, and whether an item was actually sold at the discounted price, as the AD column of the orders list shows.
get-order-discount-infoThe Automated Discounts details of one order, as the order edit screen shows them: per item the discounted price, the regular price and the discount percentage.

Minimum Prices​

AbilityWhat it does
get-product-min-pricesThe minimum price floor of products: the manual and the calculated minimum price, and the lowest price a discount is actually held at. Without product IDs, lists all products and variations that have a floor.
update-product-min-priceSets or removes the manual minimum price of one simple product or variation, like the field on the product edit screen. Refused while the manual floor is turned off.
regenerate-min-pricesRecalculates the calculated minimum price floor of all products in the background.
get-min-price-regeneration-statusProgress of the minimum price regeneration.

Diagnostics and Logs​

AbilityWhat it does
get-diagnosticsEnvironment checks: versions, license, transients and object cache, shop country and currency, tax display, and whether ad visitors keep their discount session past the landing page.
get-debug-infoThe plain-text debug report from the Support tab.
get-error-logsThe plugin's WooCommerce log files. They contain detail only while logging is on.

Each ability describes its inputs and outputs in detail, and the agent reads these descriptions itself. You don't need to know the ability names to use them.

Read-Only Mode​

To let agents read and diagnose but never change anything, add this filter. The write abilities are then not registered at all:

add_filter( 'sgadwc_abilities_allow_write', '__return_false' );

Boost your sales with Google Shopping ads. Allow Google to set your discount to secure the sale and optimize your profit margin.