Skip to main content
Glama

Get ad by id (with media)

get_ad
Read-only

Fetch a single ad by its id with FULL details including its creative media: the full ad TEXT in body, body_chars (its length in UTF-8 characters), title, creative URL, geos, status, advertiser. body is absent when the ad genuinely has no text; body_chars is absent when the length could not be read — never read an absent field as zero. Media urls on media.spytrend.com are permanent; a media entry with expiring=true is the original signed Facebook CDN link of a not-yet-mirrored fresh ad — it dies within hours/days, NEVER put it into reports or exports (re-fetch the ad later for the permanent link). QUOTA: 50 tokens for a multilang-upload ad opening; 1 token for an ordinary ad. The price includes the available media returned with this card. Each new opening call is charged separately; no subscription to an individual ad is created. A blurred card or a response without usable media is not charged. With source=tiktok: 100 tokens per delivered TikTok row. MULTILANG CONTENT: get_ad and get_media(ad) use the same full detail carousel. primary_creative identifies its selected first creative; primary_creative_selection.status describes selected, fallback or unavailable. carousel_position is the original 1-based carousel position, not the returned array index. Missing/unconfirmed selected primary media is not charged or disclosed; both tools report primary_creative_unavailable. Per-slide title/body/link_url describe that slide; when the API omits a slide override, the ad-level value is supplied as its fallback, consistently in both tools. original_landing_domain describes the original ad, while creative_destination_url/domain describe the primary creative's destination. cloaking_detected is a detected domain/copy mismatch, not a verified redirect or a guarantee that a creative is black. Actual per-call debit is reported in _meta.billing.tokens_charged, in Spytrend quota tokens (not model tokens); admin may be exempt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesthe ad id to fetch (with source=tiktok: a TikTok ad id from search_ads source=tiktok results)
sourceNoad corpus: meta (default, 1 token — delivers the ad's media) or tiktok (⚠️ 100 tokens per TikTok ad row; Pro plan required)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
sourceNo
tiktok_dataNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changed
    • addedOutput schema / properties / data / properties / creative_destination_domain
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / data / properties / creative_destination_url
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / data / properties / is_multilang
      Added value: +{
      +  "type": [
      +    "null",
      +    "boolean"
      +  ]
      +}
    • addedOutput schema / properties / data / properties / media / items / properties / body
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / data / properties / media / items / properties / carousel_position
      Added value: +{
      +  "type": [
      +    "null",
      +    "integer"
      +  ]
      +}
    • addedOutput schema / properties / data / properties / media / items / properties / claimed_domain
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / data / properties / media / items / properties / cloaking_detected
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / data / properties / media / items / properties / fallback_urls
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
    • addedOutput schema / properties / data / properties / media / items / properties / is_alive
      Added value: +{
      +  "type": [
      +    "null",
      +    "boolean"
      +  ]
      +}
    • addedOutput schema / properties / data / properties / media / items / properties / link_url
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / data / properties / media / items / properties / title
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / data / properties / opening_price
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "billing_basis": {
      +      "type": "string"
      +    },
      +    "status": {
      +      "type": "string"
      +    },
      +    "tokens": {
      +      "type": [
      +        "null",
      +        "integer"
      +      ]
      +    },
      +    "unit": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "status",
      +    "tokens",
      +    "unit",
      +    "billing_basis"
      +  ],
      +  "type": [
      +    "null",
      +    "object"
      +  ]
      +}
    • addedOutput schema / properties / data / properties / original_landing_domain
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / data / properties / primary_creative
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "body": {
      +      "type": "string"
      +    },
      +    "carousel_position": {
      +      "type": [
      +        "null",
      +        "integer"
      +      ]
      +    },
      +    "claimed_domain": {
      +      "type": "string"
      +    },
      +    "cloaking_detected": {
      +      "type": "boolean"
      +    },
      +    "expiring": {
      +      "type": "boolean"
      +    },
      +    "fallback_urls": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "is_alive": {
      +      "type": [
      +        "null",
      +        "boolean"
      +      ]
      +    },
      +    "link_url": {
      +      "type": "string"
      +    },
      +    "media_type": {
      +      "type": "string"
      +    },
      +    "snapshot_url": {
      +      "type": "string"
      +    },
      +    "thumbnail_url": {
      +      "type": "string"
      +    },
      +    "title": {
      +      "type": "string"
      +    },
      +    "url": {
      +      "type": "string"
      +    }
      +  },
      +  "type": [
      +    "null",
      +    "object"
      +  ]
      +}
    • addedOutput schema / properties / data / properties / primary_creative_selection
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "carousel_position": {
      +      "type": [
      +        "null",
      +        "integer"
      +      ]
      +    },
      +    "reason": {
      +      "type": "string"
      +    },
      +    "status": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "status"
      +  ],
      +  "type": [
      +    "null",
      +    "object"
      +  ]
      +}
  2. First observed

TDQS

A4/5.0
Behavior5/5

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

The description adds substantial behavioral context beyond the readOnlyHint/openWorldHint/negative-destructive annotations: it details quota semantics (50/1/100 tokens), the live status of unsigned expiring CDN links (never put in reports), billing debits via `_meta.billing.tokens_charged`, no-charge edge cases (blurred cards, no usable media), no subscription behavior, field-absence semantics (body_index), and primary_creative selection status. This is rich, actionable behavior that far exceeds the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The description is thorough but long and dense, with many paragraphs and repeated references to the shared carousel used by both tools. It front-loads 'Fetch a single ad by its id' and then layers a large amount of billing and media edge-case detail. Every sentence does add value, yet the volume of information could overwhelm the average agent; there is no pruning or prioritization.

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?

Backed by a high coverage schema and output schema, the description still adds edge cases that are not present in structured data: body-field absence logic, the `expiring` CDN flag and its consequences, billing charge rules, `_meta.billing.tokens_charged`, and also the special behavior when source=tiktok. Considering the complexity of the tool and the provided schemas, this description is highly complete, although it could leave a few niche topics (e.g., error codes for non-existent ad IDs) to inference.

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?

Input schema has 100% description coverage for both parameters: `id` and `source` already have robust descriptions including source default and pricing. The tool description adds pricing side-effects and source-specific price warnings (`source=tiktok` in provenance), but does not add any meaning about parameter syntax, types, or constraints beyond what the schema defines. Baseline 3 is appropriate because the schema carries the weight.

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 and resource: 'Fetch a single ad by its id with FULL details including its creative media'—clearly distinguishing it from siblings like get_creative or get_media. It also enumerates exact fields returned (text, body_chars, title, creative URL, geo, status, advertiser), making the tool's scope unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

The context of use is implied: call this when you need a single ad's full details by ID. However, it does not explicitly state when to choose this tool over get_media or get_creative, aside from a note that get_media(ad) has the same detail carousel. The source=tiktok switch is described, but no alternative pathway or 'do not use when' guidance is given, so the description carries only implied usage direction.

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.