Skip to main content
Glama
MoonEyes

google-ecommerce-mcp

Google Ads GAQL query

gads_query
Read-onlyIdempotent

Run a read-only GAQL SELECT on one Google Ads customer to fetch custom reporting fields outside fixed templates. Use it for tailored campaign, keyword, and performance queries.

Instructions

Run a free read-only Google Ads Query Language (GAQL) SELECT on one customer (searchStream), for fields the fixed gads_performance templates do not cover. Refused without any network call unless it is a single SELECT with no ';' and no '--' or '/' (refused even inside a string literal). The read is bounded: without LIMIT, LIMIT 10001 is added (before PARAMETERS); a larger LIMIT is lowered to 10001; the answer is capped at 20 MB. One SELECT and one FROM only, no JOIN, no backslash, ASCII only outside string literals. FROM and every dotted name prefix in SELECT, WHERE and ORDER BY (besides metrics and segments) must be a reporting resource: customer, campaign, campaign_budget, ad_group, ad_group_ad, ad_group_criterion, keyword_view, shopping_performance_view, product_group_view, asset_group, asset_group_listing_group_filter, asset_group_asset, asset, ad_group_ad_asset_view, campaign_criterion, geographic_view, gender_view, age_range_view, landing_page_view, expanded_landing_page_view, display_keyword_view, topic_view, bidding_strategy, conversion_action, location_view, distance_view, with customer. limited to id, descriptive_name, currency_code, time_zone, status, manager, test_account and resource_name; anything else is refused with resource_not_allowed. Names exposing personal data (change_event, click_view, call_view, search term views, leads, user_*, payments_*, billing_*, customer_user_access, invoices, account links, placements...) are refused anywhere in the query with sensitive_resource. Setting GADS_ALLOW_SENSITIVE_QUERIES=1 in the server env lifts both lists (personal data possible). Rows are flattened to GAQL field names (campaign.name, metrics.clicks); micros fields are converted to currency units: micros renamed without the suffix (metrics.cost_micros -> metrics.cost), metrics.average_cpc, average_cpm, average_cost and cost_per kept under their name.

Input Schema

NameRequiredDescriptionDefault
gaqlYesOne read-only GAQL statement starting with SELECT, e.g. SELECT campaign.name, metrics.clicks FROM campaign WHERE segments.date DURING LAST_7_DAYS; no ';', '--' or '/*' anywhere, even in a string
limitNoMaximum rows returned (1 to 1000); Google is asked for at most 10,001 rows (LIMIT added or lowered)
client_idNoClient id from clients_list; empty uses the only client
customer_idNoGoogle Ads customer id (digits, dashes allowed), as listed by gads_accounts; empty uses the client's (or GADS_CUSTOMER_ID)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.5.0
    • addedInput schema / properties / client_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Client id from clients_list; empty uses the only client",
      +  "title": "Client Id"
      +}
    • changedInput schema / properties / customer_id / description
      Previous value: -"Google Ads customer id (digits, dashes allowed), as listed by gads_accounts; empty uses the configured GADS_CUSTOMER_ID"New value: +"Google Ads customer id (digits, dashes allowed), as listed by gads_accounts; empty uses the client's (or GADS_CUSTOMER_ID)"
  2. Addedv0.4.0

TDQS

A4.4/5.0
Behavior5/5

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

Goes far beyond the readOnly/idempotent annotations: it discloses that malformed queries are refused with no network call, the exact validation rules (single SELECT, no ';', '--', '/*' even in literals, ASCII only, no backslash/JOIN), the server-side row bounds (LIMIT 10001 injected or lowered, 20 MB cap), the resource allowlist and the sensitive_resource refusal list, the env-var override, and the returned row shape. This is unusually complete behavioral disclosure for a mutation-free query tool.

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 the gads_performance differentiator come first, then the validation and bounds. It is long but nearly every clause carries a constraint the agent must satisfy; only the resource allowlist is bloated by enumeration and the no-';' rule duplicates the schema text.

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 raw-query tool with no output schema this covers the full contract: input grammar, refusal behavior, row/byte caps, allowlisted resources, sensitive-data refusals, and the return shape (flattened GAQL field names, *_micros → currency units). Nothing an agent needs to formulate a valid, non-refused query is missing.

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

Parameters3/5

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

Schema coverage is 100%, so gaql, limit, client_id and customer_id are already documented; the description mostly restates the gaql constraint that the schema states verbatim. It adds some value by explaining the interaction between a user LIMIT and the internal 10,001 ceiling, but says nothing extra about client_id/customer_id resolution or the output `limit` semantics.

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 (run a read-only GAQL SELECT), the resource (one Google Ads customer via searchStream), and the scope that distinguishes it from siblings ('fields the fixed gads_performance templates do not cover'). An agent can separate this from gads_performance, gads_accounts and gads_conversion_actions without opening any 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?

The phrase 'for fields the fixed gads_performance templates do not cover' explicitly routes the agent away from the sibling and toward this tool when the templated report is insufficient. It also states the prerequisite (a customer_id from gads_accounts / GADS_CUSTOMER_ID), though it never gives explicit when-not-to-use exclusions for the other gads siblings.

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

Deploy Server

Other Tools