Skip to main content
Glama

Google Ads & Meta Ads

Merchant Center: Run Query

gmc_query
Read-onlyIdempotent

Run a read-only Merchant Center Query Language (MCQL) SELECT against one Google Merchant Center account and return the rows: product approval status and item issues, clicks and impressions per product, price benchmarks, best sellers, competitor visibility. This tool cannot change anything in Merchant Center. Syntax is GAQL-like: SELECT fields FROM one_view [WHERE a = 'x' AND b > 1] [ORDER BY a field in SELECT] [LIMIT n]; operators = != < <= > >= IN NOT IN LIKE REGEXP_MATCH BETWEEN DURING (date DURING LAST_30_DAYS / LAST_7_DAYS / THIS_MONTH, or date BETWEEN '2026-10-01' AND '2026-10-31'); AND only, no OR, no parentheses, no joins; a metric may be filtered only if it is also selected. Fields are written in snake_case and come back in camelCase; money is {amountMicros, currencyCode} — divide by 1,000,000. A query with no LIMIT gets LIMIT 100; LIMIT above 1000 is lowered to it. Views (* = must be in SELECT; ‡ = must be filtered in WHERE; † = WHERE only, cannot be selected; ~ = cannot be filtered on.): • product_performance_view — clicks, impressions, CTR and (free listings only) conversions per product or segment, over a date range. Fields: date‡, week, marketing_method, customer_country_code, store_type, offer_id, title, brand, category_l1..l5, product_type_l1..l5, custom_label0..4, clicks, impressions, click_through_rate, conversions, conversion_value, conversion_rate. • non_product_performance_view — clicks and impressions on non-product surfaces (store and image links) over a date range. Fields: date‡, week, clicks, impressions, click_through_rate. • product_view — the catalog as Google holds it: every product with its approval status, item issues, price, availability and click potential; no date range. Fields: id*, channel, language_code, feed_label, offer_id, title, brand, category_l1..l5, product_type_l1..l5, price, condition, availability, shipping_label, item_group_id, thumbnail_link, gtin~, creation_time, expiration_date, aggregated_reporting_context_status, status_per_reporting_context~, item_issues~, click_potential, click_potential_rank, reporting_context†. • price_competitiveness_product_view — your price against Google's benchmark price per product and country (Market Insights must be enabled in Merchant Center). Fields: report_country_code*, id*, offer_id, title, brand, category_l1..l5, product_type_l1..l5, price, benchmark_price. • price_insights_product_view — Google's suggested price per product with the predicted change in impressions, clicks and conversions (Market Insights). Fields: id*, offer_id, title, brand, category_l1..l5, product_type_l1..l5, price, suggested_price, effectiveness, predicted_impressions_change_fraction, predicted_clicks_change_fraction, predicted_conversions_change_fraction. • best_sellers_product_cluster_view — Google's best-selling product clusters per category and country, weekly or monthly, with whether your inventory carries them (Market Insights). Fields: report_date*, report_granularity*‡, report_country_code*‡, report_category_id*, title, brand, category_l1..l5, variant_gtins, inventory_status, brand_inventory_status, rank, previous_rank, relative_demand, previous_relative_demand, relative_demand_change. • best_sellers_brand_view — Google's best-selling brands per category and country, weekly or monthly (Market Insights). Fields: report_date*, report_granularity*‡, report_country_code*‡, report_category_id*, brand, rank, previous_rank, relative_demand, previous_relative_demand, relative_demand_change. • competitive_visibility_competitor_view — the merchants competing with you for the same Shopping impressions in a category and country, ranked, over a date range (Market Insights). Fields: date‡, domain, is_your_domain, report_country_code‡, report_category_id*‡, traffic_source*, rank~, ads_organic_ratio~, page_overlap_rate~, higher_position_rate~, relative_visibility~. • competitive_visibility_top_merchant_view — the top merchants by Shopping visibility in a category and country, you among them, over a date range (Market Insights). Fields: date‡†, domain, is_your_domain, report_country_code‡, report_category_id*‡, traffic_source*, rank~, ads_organic_ratio~, page_overlap_rate~, higher_position_rate~. • competitive_visibility_benchmark_view — your Shopping visibility trend against the category benchmark, per day (Market Insights). Fields: date*‡, report_country_code*‡, report_category_id*‡, traffic_source*, your_domain_visibility_trend~, category_benchmark_visibility_trend~. Examples: disapproved products — SELECT id, offer_id, title, aggregated_reporting_context_status, item_issues FROM product_view WHERE aggregated_reporting_context_status = 'NOT_ELIGIBLE_OR_DISAPPROVED'. Top products by paid clicks — SELECT offer_id, title, clicks, impressions, click_through_rate FROM product_performance_view WHERE date DURING LAST_30_DAYS AND marketing_method = 'ADS' ORDER BY clicks DESC LIMIT 50.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "gmc_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe MCQL statement, e.g. "SELECT offer_id, title, clicks, impressions FROM product_performance_view WHERE date DURING LAST_30_DAYS ORDER BY clicks DESC". One SELECT from one view, no semicolon.
account_idNoNumeric Merchant Center account id, from gmc_list_accounts. May be left out when the connected login reaches exactly one account.

Output Schema

NameRequiredDescriptionDefault
rowsYesOne object per result row — the view's fields in camelCase exactly as the Merchant API returns them, unwrapped from the per-view envelope.
viewYesThe view the query read (FROM).
queryYesThe query as actually sent, which differs from the one passed in when a LIMIT was added or lowered.
rowCountYesNumber of rows returned.
accountIdYesMerchant Center account the query ran against.
truncatedYesTrue when the row cap was reached, so more rows match than were returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so the safety profile is covered. The description still adds substantial non-structured behavior: a missing LIMIT is forced to 100, a LIMIT above 1000 is lowered to it, only AND is allowed (no OR, parentheses or joins), and results come back in camelCase with money as {amountMicros, currencyCode} to be divided by 1,000,000.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded correctly: purpose and safety in the first two sentences, then grammar rules, then the view catalog as a bulleted reference with a legend, then examples. The prose is dense but nearly every clause carries a constraint an agent would otherwise get wrong; the cost is overall length, with the ten-view field dump sitting close to the limit of what belongs in a description rather than a schema or resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a query-language tool whose real complexity lives in the query string, the definition covers syntax, limits, field-format conversion, view selection, per-view field markers and two full examples. Return values need not be explained because an output schema exists, and what remains is the camelCase/micros convention, which is included.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100% for the two parameters, but the description supplies the actual grammar the query string must obey (SELECT/FROM/WHERE/ORDER BY/LIMIT, operator list, DURING ranges, metric-filter-must-be-selected rule) plus per-view field constraints marked with *, ‡, †, ~. This is meaning well beyond the schema's single example string, and account_id's fallback behavior is reinforced.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — 'Run a read-only Merchant Center Query Language (MCQL) SELECT against one Google Merchant Center account' — and enumerates the outcome domains (approval status/item issues, performance, price benchmarks, best sellers, competitor visibility). That is enough to tell it apart from single-object siblings like gmc_get_product or gmc_get_account_health without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clear context is given: it is read-only ('This tool cannot change anything in Merchant Center') and two worked examples show the approved query shapes, which implicitly steer the agent toward analytics use. It stops short of naming when NOT to use it or pointing at siblings for single-product or settings reads, so no explicit alternative routing is present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources