Skip to main content
Glama
kLOsk

AdLoop: Google Ads, Reddit Ads & GA4

Custom Google Ads query

run_gaql
Read-only

Execute arbitrary Google Ads Query Language (GAQL) queries to retrieve custom reports beyond built-in report tools, returning rows as table, JSON, or CSV.

Instructions

Execute an arbitrary GAQL (Google Ads Query Language) query.

For queries beyond the dedicated report tools. Returns the result rows in the requested format with the query echoed back; cost fields stay in raw micros (cost_micros / 1,000,000 = account currency). A failing query returns an error with a hint.

Queries the Google Ads API. GAQL syntax and fields: https://developers.google.com/google-ads/api/docs/query/overview

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe GAQL query, e.g. "SELECT campaign.name, metrics.clicks FROM campaign WHERE segments.date DURING LAST_7_DAYS".
formatNoOutput format: "table" (default, readable), "json" (structured), or "csv" (exportable).table
customer_idNoGoogle Ads customer ID, digits with or without dashes (123-456-7890). Empty uses the configured default account.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.27.1
    • addedInput schema / properties / customer_id / description
      Added value: +"Google Ads customer ID, digits with or without dashes\n(123-456-7890). Empty uses the configured default account."
    • addedInput schema / properties / format / description
      Added value: +"Output format: \"table\" (default, readable), \"json\"\n(structured), or \"csv\" (exportable)."
    • addedInput schema / properties / query / description
      Added value: +"The GAQL query, e.g. \"SELECT campaign.name, metrics.clicks\nFROM campaign WHERE segments.date DURING LAST_7_DAYS\"."
  2. Addedv0.13.2
  3. Removedv0.13.0
  4. First observedv0.9.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already carry the safety profile (readOnlyHint=true, destructiveHint=false, openWorldHint=true), so the bar is lower, yet the description adds real behavioral context: the query is echoed back, cost fields remain in raw micros with the conversion formula, and failures return an error with a hint. It does not mention rate limits, row caps, or pagination, which is the remaining gap for an arbitrary-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.

Conciseness5/5

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

Purpose is front-loaded in the first line, followed by the disambiguation, then return semantics and error behavior, with the docs link last as a reference. Every sentence carries information; nothing is redundant with the schema or annotations.

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

Completeness4/5

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

With an output schema present, return values need not be re-explained, and the description correctly focuses on scope, format echoing, micros handling, and error behavior. An arbitrary-query tool could still benefit from noting limits or that GAQL validity is the caller's responsibility, but the essentials are covered.

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 description coverage is 100% and each parameter (query, format, customer_id) is fully documented in the schema, including enum-like format values and the dashed/undashed customer ID. The description adds no parameter-level detail beyond what the schema already provides, so the baseline 3 applies.

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?

The description opens with a specific verb+resource ('Execute an arbitrary GAQL query') and explicitly positions itself against the siblings: 'For queries beyond the dedicated report tools.' An agent can tell this is the escape hatch versus get_campaign_performance or get_ad_performance without opening either 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?

It states the selecting condition clearly ('beyond the dedicated report tools'), which routes the agent here only when no dedicated tool covers the query. It stops short of naming which dedicated report tool to prefer for common cases, so it is clear context rather than a full when/when-not matrix.

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