Skip to main content
Glama
google-ad-manager-mcp

google-ad-manager-mcp

by Jakob-Peters

gam_pql_query

Read-onlyIdempotent

Run read-only PQL SELECT queries against Google Ad Manager Publisher Query Language tables to retrieve data not exposed by find tools, including targeting lookups.

Instructions

MODE: read-only. Run a PQL SELECT against GAM's Publisher Query Language tables (Line_Item incl. its full Targeting column for reverse targeting lookups, Ad_Unit, Placement, Programmatic_Buyer, Audience_Segment, Exchange_Rate, Browser, Device_Category, Mobile_Device, Time_Zone, Child_Publisher, MCM_Earnings, …). Column/table names are identifier-validated; literal VALUES must go in the values map (bind variables — quotes in where are rejected). OUTPUT: columns + row arrays; int64s beyond 2^53 stay strings. WHEN TO USE: data the 'find' tools don't expose, e.g. 'which line items target key X' (SELECT Id, Name, Targeting FROM Line_Item WHERE CustomTargeting LIKE …); struct columns like Targeting return as JSON. LIMITS: DateTime columns can't be filtered here (binds are text/number/boolean only); for paging beyond one page pass order_by — PQL row order is unstable without it. NOT for Change_History — use gam_change_history (it handles that table's special pagination rules).

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": {
      "table": "<table>"
    },
    "name": "gam_pql_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoDefault 100, max 500.
tableYesPQL table, e.g. Line_Item, Ad_Unit, Placement.
whereNoWHERE clause without the keyword; NO quoted literals — reference binds like `status = :s`.
offsetNo
valuesNoBind variables referenced in `where` (LIKE patterns include % here, e.g. '%key=123%').
columnsNoColumns to select, e.g. ['Id','Name']. Omit only with describe=true.
describeNoDISCOVERY MODE: return the valid COLUMN NAMES for `table` instead of running a query. Do this first — PQL column names are not the REST field names and cannot be guessed. Costs one cheap API call.
order_byNoe.g. 'Id ASC'.
network_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, and the 'MODE: read-only' line simply restates that. The description does add genuine behavior beyond the annotations: identifier validation on table/column names, rejection of quoted literals in `where`, the int64-as-string output rule, the DateTime filtering restriction, and unstable row order without order_by. Because it spends its opening clause repeating the annotation safety profile, it lands short of the top band despite the rich limits section.

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-loads mode, then tables, then output, then usage, then limits – a sensible priority order with labeled sections that make skimming easy. It is dense and a few clauses (the long table enumeration, the two separate warnings about literals) could be trimmed without losing information.

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?

Nine parameters, no annotations-level safety gaps, and no output schema — yet the description explains the return shape (columns plus row arrays, struct columns as JSON, int64 strings), the describe discovery path, and the pagination caveat. An agent has everything needed to call it correctly and interpret the result.

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

Parameters4/5

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

Schema coverage is 78%, and the description adds real meaning on top: literal values must be bound via `values`, quotes in `where` are rejected, LIKE patterns carry their % inside the bind map, and order_by is required for stable paging. It does not explain network_code or offset, so it is not fully additive.

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 PQL SELECT) and resource (GAM's Publisher Query Language tables), then enumerates the concrete tables available. It draws a clear line against the 'find' tools and gam_change_history, so an agent can distinguish it from siblings 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 Guidelines5/5

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

Explicit 'WHEN TO USE' with a worked example ('which line items target key X') plus a concrete exclusion: 'NOT for Change_History — use gam_change_history'. It also tells the agent to call describe=true first, which is real routing guidance rather than generic advice.

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