Skip to main content
Glama

Get ChatGPT Ads campaign insights

get-openai-ads-campaign-insights
Read-only

Get spend, impressions, clicks, CTR, CPC and CPM for one ChatGPT Ads campaign over a date range, as {data, has_more}. Defaults to one rollup row; aggregation_level ad_group or ad gives a row per child. campaign_id comes from list-openai-ads-campaigns. Set include_sales for order sales, ROAS, CPA and post-click conversion rate under the given attribution windows.

Input Schema

NameRequiredDescriptionDefault
sortNoSort directives, an array of {field, direction}. Example: [{"field":"spend","direction":"desc"}].
limitNoMax rows
sinceYesRange start date (YYYY-MM-DD, inclusive)
untilYesRange end date (YYYY-MM-DD, inclusive)
domain_idYesDomain ID from list-domains
time_basisNoWhether results are dated by ad_event_time or conversion_time. Defaults to ad_event_time. Applied only when include_sales is true.
campaign_idYesCampaign ID from list-openai-ads-campaigns
include_salesNoAlso return conversions, CPA, post-click conversion rate, order sales and ROAS. Defaults to false.
time_granularityNoTime granularity. Defaults to none (single rollup row).
view_window_daysNoView-through attribution window in days: 0 (off) or 1. Defaults to 1. Applied only when include_sales is true.
aggregation_levelNoRow grain: ad_account, campaign, ad_group or ad. Defaults to campaign, one row for the whole scope.
click_window_daysNoClick attribution window in days: 7, 14 or 30. Defaults to 30. Applied only when include_sales is true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / click_window_days / description
      Previous value: -"Click attribution window in days: 7, 14 or 30. Defaults to 30."New value: +"Click attribution window in days: 7, 14 or 30. Defaults to 30. Applied only when include_sales is true."
    • changedInput schema / properties / time_basis / description
      Previous value: -"Whether results are dated by ad_event_time or conversion_time. Defaults to ad_event_time."New value: +"Whether results are dated by ad_event_time or conversion_time. Defaults to ad_event_time. Applied only when include_sales is true."
    • changedInput schema / properties / view_window_days / description
      Previous value: -"View-through attribution window in days: 0 (off) or 1. Defaults to 1."New value: +"View-through attribution window in days: 0 (off) or 1. Defaults to 1. Applied only when include_sales is true."
  2. Changed3 schema fields changed
    • changedInput schema / properties / campaign_id / description
      Previous value: -"Campaign ID"New value: +"Campaign ID from list-openai-ads-campaigns"
    • changedInput schema / properties / domain_id / description
      Previous value: -"Domain ID"New value: +"Domain ID from list-domains"
    • changedInput schema / properties / limit / description
      Previous value: -"Max rows to return"New value: +"Max rows"
  3. Changed3 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / domain_id / pattern
      Added value: +"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    • removedInput schema / properties / sort / items / additionalProperties
      Removed value: -false
  4. Changed8 schema fields changed
    • addedInput schema / properties / click_window_days
      Added value: +{
      +  "description": "Click attribution window in days: 7, 14 or 30. Defaults to 30.",
      +  "enum": [
      +    7,
      +    14,
      +    30
      +  ],
      +  "type": "number"
      +}
    • addedInput schema / properties / include_sales
      Added value: +{
      +  "description": "Also return conversions, CPA, post-click conversion rate, order sales and ROAS. Defaults to false.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / sort / items / properties / field / description
      Previous value: -"Metric name, e.g. \"spend\", \"clicks\", \"impressions\", \"ctr\", \"cpc\", \"cpm\"."New value: +"Metric to sort by: spend, impressions, clicks, ctr, cpc or cpm. Sales figures, conversions included, cannot be sorted on."
    • addedInput schema / properties / sort / items / properties / field / enum
      Added value: +[
      +  "spend",
      +  "impressions",
      +  "clicks",
      +  "ctr",
      +  "cpc",
      +  "cpm"
      +]
    • removedInput schema / properties / sort / items / properties / field / minLength
      Removed value: -1
    • addedInput schema / properties / sort / maxItems
      Added value: +5
    • addedInput schema / properties / time_basis
      Added value: +{
      +  "description": "Whether results are dated by ad_event_time or conversion_time. Defaults to ad_event_time.",
      +  "enum": [
      +    "ad_event_time",
      +    "conversion_time"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / view_window_days
      Added value: +{
      +  "description": "View-through attribution window in days: 0 (off) or 1. Defaults to 1.",
      +  "enum": [
      +    0,
      +    1
      +  ],
      +  "type": "number"
      +}
  5. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover the read-only, non-destructive safety profile, and the description adds real value on top: the {data, has_more} envelope, the single-rollup default, and per-child rows under ad_group/ad. It does not explain how has_more is to be paged (no cursor/offset parameter is exposed), which is the one behavioral gap.

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?

Four dense sentences, front-loaded with the returned metrics and the {data, has_more} shape, then defaults and the sales switch. Nothing is wasted, though the last sentence is packed with several independent facts in one breath.

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 12 parameters, no output schema and a complex conditional-sales surface, the description covers the return shape, defaults and the sales gating condition. Missing pagination mechanics around has_more is the remaining small hole for an otherwise complete definition.

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 100%, so the baseline is 3; the description still adds meaning by explaining that aggregation_level controls row grain and that include_sales gates the sales, ROAS and CPA metrics (which in turn activate the attribution-window params). It does not touch sort or limit, but those are well documented in the schema.

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 names a specific verb+resource ('Get spend, impressions, clicks, CTR, CPC and CPM for one ChatGPT Ads campaign over a date range') and states the exact return envelope. The phrase 'one ChatGPT Ads campaign' plus the aggregation_level note distinguishes it cleanly from the sibling account-, ad-group- and ad-level insights tools.

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 gives clear routing context: campaign_id must come from list-openai-ads-campaigns, and include_sales is the switch for sales/ROAS/CPA metrics. It stops short of naming when to prefer get-openai-ads-account-insights or the ad_group/ad-level variants, which the agent must infer from granularity.

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