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

google-ad-manager-mcp

by Jakob-Peters

gam_ad_unit_tree

Read-onlyIdempotent

Resolve Google Ad Manager ad-unit names to IDs with full hierarchy paths, status, and parent filters for forecasts, targeting, and inventory structure lookups.

Instructions

MODE: read-only, cached 1h. UI: Inventory → Ad units. The ad-unit hierarchy: id, name, code, parent, full path, status, specialAdUnit (= GAM's 'explicitly targeted' mark — only serves when targeted directly), hasChildren. Filter by name/code search, parent (direct children), or status. OUTPUT: flat rows with resolved paths — ids feed forecast/targeting inputs. WHEN TO USE: resolving ad-unit names→ids for forecasts, structure questions, finding a publisher's units. Set refresh=true after known GAM inventory changes.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "gam_ad_unit_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoDefault 100.
offsetNo
searchNoCase-insensitive substring on name, code, or path.
statusNo
refreshNoBypass the 1h cache.
network_codeNo
parent_ad_unit_idNoOnly direct children of this ad unit.
include_special_onlyNoOnly 'special' (explicitly targeted) ad units.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotent/non-destructive, so the safety profile is covered; the description adds genuinely new behavior: a 1h cache with a refresh bypass and the semantics of specialAdUnit (only serves when targeted directly), which is domain knowledge not present in annotations or schema. It does not discuss rate limits or error behavior, and the cache detail is the main extra.

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 with MODE, UI location, field list, filters, output, then when-to-use — a sensible priority order for a compact definition. The telegraphic style (em-dashes, abbreviations) is dense but every clause carries information; no filler sentences.

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 an 8-parameter, no-output-schema listing tool it covers purpose, filter behavior, output shape (flat rows with resolved paths, ids feed forecast/targeting inputs), caching, and refresh. Pagination semantics are left to the schema's limit/offset descriptions, which is an acceptable division of labor.

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?

At 63% schema coverage the description usefully picks up the slack: it states that search matches name/code, that parent_ad_unit_id returns only direct children, that status is a filter, and explains include_special_only via the specialAdUnit definition. limit/offset/network_code are left to the schema, but the filter semantics added are clearly beyond the raw schema.

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

Purpose4/5

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

Names the resource (ad-unit hierarchy) and enumerates the returned fields — id, name, code, parent, full path, status, specialAdUnit, hasChildren — so the agent knows exactly what it gets. It does not explicitly differentiate itself from siblings like gam_get_ad_unit or gam_ad_unit_sizes, leaving the agent to infer that this one returns the whole tree.

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?

"WHEN TO USE: resolving ad-unit names→ids for forecasts, structure questions, finding a publisher's units" gives three concrete scenarios, and the refresh=true trigger is tied to a specific condition (known GAM inventory changes). There is no explicit when-not statement or named alternative for single-unit lookups, so it stops short of a 5.

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