Writing AMC SQL with AI: provide the schema and check the result

In short: AI models write usable AMC SQL if you give them the schema of the tables, and otherwise invent fields and functions. Check every result: field names against the schema reference, functions against Amazon's list, `user_id` never in the final SELECT. Test in the sandbox first, then in the instance.

The workflow

  • Provide the schema: copy the field list of the tables involved from the schema reference into the prompt, including thresholds. Without a schema the model guesses field names.
  • Provide the rules: final SELECT without VERY_HIGH fields such as user_id (only in CTEs or inside COUNT(DISTINCT …)), no literal filters on fields with a high threshold.
  • Check the result (see below), run it in the sandbox, then in the instance.

Typical missteps and how to spot them

MisstepHow to check
Invented function (for example SIMILARITY or ARRAY_JOIN)Check against Amazon's function list; it has ARRAY_TO_STRING, for example
Invented or misspelled fieldLook up each name in the schema reference of the table
user_id in the final SELECTAMC rejects it; user_id only in a CTE or in COUNT(DISTINCT user_id)
Multi-line SQL in an API requestMake sqlQuery single-line, without tabs and line breaks
Too many similar variants in a rowCombine queries; AMC rejects executions on overlapping data sources

Amazon's own tools for AMC SQL

Besides your own model with the schema, Amazon itself offers two routes since 2026. Status as of 2026-11-18 according to Amazon's announcements:

RouteStatusRegionPrerequisiteCost
Amazon Ads Agent (conversation directly in AMC)available according to Amazon for advertisers working directly in AMCnot statedAMC instancenot stated
AMC SQL Generator (expert tool on the Amazon Ads MCP Server)Closed beta since 2026-09-30, application required; general availability announced for early 2027US only during the betaactive AMC instance, developer account, Amazon Ads API accesscovered by Amazon during the beta; from 2027 pay per token via AWS Marketplace
Your own model (ChatGPT, Claude) with the schemaright awayno restriction by Amazonschema and rules in the promptyour model contract

Check SQL generated by Amazon the same way as above against schema and thresholds, and test it in the sandbox. The Amazon Ads MCP Server itself has been in an open beta since 2026-02-02 for partners with active API credentials.

Privacy when prompting

Give the model the schema and synthetic or sandbox examples, not result rows with real campaign or customer data. In the workflow documentation Amazon explicitly points out never to put information about individuals into descriptions or parameter values. Which data an external provider may see is for your data protection office to decide.

Sources: Amazon Ads API: AMC SQL functions · Amazon Ads API: Manage a workflow · Amazon Ads API: Manage workflow executions · Amazon Ads: Expert tools bring AMC SQL generation to your agent · Amazon Ads: Amazon Ads MCP Server open beta (retrieved 2026-10-09)

Keep reading: Schema reference · SQL function reference · AMC sandbox