Skip to main content
Glama

Get an Ad or Advertiser

get_ad

Use when you need one Ad or Advertiser, in exactly one of five modes: library_id (Meta Ad), page_id (Meta Advertiser), advertiser_id (TikTok or Google Advertiser), tiktok_ad_id (TikTok Ad) or google_ad_id (Google Ad). Not for finding Ads: use search_ads (advertiser=page_id). Price: Ad 3 credits, +20 credits with analyze; Advertiser 15 credits. Ads: copy, landing URL, media, dates, spend, reach; TikTok adds targeting. A removed Ad is from our copy. Unknown ids: not_found, free.

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": "get_ad"
  }
}

Input Schema

NameRequiredDescriptionDefault
analyzeNoAd mode: add the Ad's analysis: charged whether computed or already stored. A TikTok Ad answered by Creative Center refuses it: media_unavailable, free.
page_idNoAdvertiser mode: the Advertiser's numeric Facebook Page id.
estimateNoQuote the price in Credits: no Run, no charge
platformNometa (default, page_id), tiktok or google (advertiser_id).
library_idNoMeta Ad Library id, the number in facebook.com/ads/library/?id=...
max_creditsNo
google_ad_idNoCR id or Transparency URL; unstored, also advertiser_id.
tiktok_ad_idNoTikTok mode: the TikTok ad library id, the number in library.tiktok.com/ads/detail/?ad_id=... or an id from a TikTok search_ads
advertiser_idNoTikTok (adv_biz_ids) or (platform=google) AR id, library URL or name; or the AR id beside google_ad_id.
idempotency_keyNoReuse on a retry: replays the original Run, not charged again

Output Schema

NameRequiredDescriptionDefault
runNo
cachedNo
resultNo
poll_urlNo
priced_perNo
estimate_creditsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / advertiser_id / description
      Previous value: -"TikTok Advertiser mode: the TikTok ad library advertiser id (adv_biz_ids), its library.tiktok.com URL or its name"New value: +"TikTok (adv_biz_ids) or (platform=google) AR id, library URL or name; or the AR id beside google_ad_id."
    • addedInput schema / properties / google_ad_id
      Added value: +{
      +  "description": "CR id or Transparency URL; unstored, also advertiser_id.",
      +  "type": "string"
      +}
    • changedInput schema / properties / platform / description
      Previous value: -"Advertiser mode: meta (default) or tiktok. With tiktok, pass advertiser_id."New value: +"meta (default, page_id), tiktok or google (advertiser_id)."
    • changedInput schema / properties / platform / enum
      Previous value: -[
      -  "meta",
      -  "tiktok"
      -]New value: +[
      +  "meta",
      +  "tiktok",
      +  "google"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / analyze / description
      Previous value: -"Ad mode: add the Ad's analysis: charged whether computed or already stored."New value: +"Ad mode: add the Ad's analysis: charged whether computed or already stored. A TikTok Ad answered by Creative Center refuses it: media_unavailable, free."
  3. Changed4 schema fields changed
    • changedInput schema / properties / estimate / description
      Previous value: -"Return the price, in Credits, without running the operation or creating a Run"New value: +"Quote the price in Credits: no Run, no charge"
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"Reuse the same key when retrying: a repeat returns the original Run and is not charged again"New value: +"Reuse on a retry: replays the original Run, not charged again"
    • changedOutput schema / properties / run / additionalProperties
      Previous value: -trueNew value: +{}
    • removedOutput schema / properties / run / properties
      Removed value: -{}
  4. Changed1 schema field changed
    • addedInput schema / properties / max_credits
      Added value: +{
      +  "minimum": 0,
      +  "type": "integer"
      +}
  5. Changed1 schema field changed
    • addedOutput schema / properties / poll_url
      Added value: +{
      +  "format": "uri",
      +  "type": "string"
      +}
  6. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "cached": {
      +      "type": "boolean"
      +    },
      +    "estimate_credits": {
      +      "type": "integer"
      +    },
      +    "priced_per": {
      +      "type": "string"
      +    },
      +    "result": {
      +      "$ref": "#/properties/run"
      +    },
      +    "run": {
      +      "additionalProperties": true,
      +      "properties": {},
      +      "type": "object"
      +    }
      +  },
      +  "type": "object"
      +}
  7. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only give generic hints (openWorld, not idempotent, not destructive); the description adds real substance: credit costs (3 / +20 with analyze / 15 for Advertiser), which failures are free (not_found, media_unavailable), that removed Ads come from the tool's own copy, and that analyze is charged even when cached. That is well beyond the structured fields. Minor gap: it never reconciles the getter framing with readOnlyHint=false, which an agent may find puzzling.

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 the primary use case and the mode list, and every line carries information (routing, price, failure semantics). The telegraphic fragments ('Price: Ad 3 credits, +20 credits with analyze') are dense but readable. Slight cost in flow from compressing five modes into one sentence.

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?

Ten parameters with zero required fields is exactly the case where 'exactly one of five modes' must be stated, and it is. With an output schema present, the brief field summary (copy, landing URL, media, dates, spend, reach; TikTok adds targeting) is a bonus rather than a necessity. Pricing, idempotency intent, and free-failure behavior round out what an agent needs to call it correctly.

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 90%, so the baseline is 3, but the description adds genuine semantic value by explaining that the id parameters are alternative entry points into distinct modes and by tying platform to page_id vs advertiser_id. It also conveys the cost consequence of analyze, which the schema only hints at. It does not clarify max_credits or estimate, leaving a little on the table.

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 and resource ('Get one Ad or Advertiser') and immediately enumerates the five mutually exclusive id modes that select which entity is returned. It also names the sibling it is not (search_ads) with the exact parameter to use instead, so an agent can separate it from the other lookups 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?

Gives explicit when-to-use ('when you need one Ad or Advertiser') and an explicit when-not with the alternative named ('Not for finding Ads: use search_ads (advertiser=page_id)'). Mode selection is spelled out per id type, so the agent knows which branch of the tool to enter.

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