Skip to main content
Glama

Get Ad Media

get_ad_media
Read-only

Get direct download links for ad creatives, so the user can save the files or push them into their own storage. Use this when the user asks to download, save, export or archive ads. Included on paid plans; on Free it returns a note saying so. Pass up to 20 refs copied from earlier tool output: Meta {ad_id, page_id}, Google {ad_url}, LinkedIn {linkedin_id}, TikTok {tiktok_id}. Returns, per ad, the image or video URL (every slide for a carousel ad), media type, brand, a suggested filename, a download_url that saves the file under that filename when the user clicks it, and an expiry note; refs that could not be resolved are listed as unresolved. Links are signed and expire (Meta within days, TikTok in about 6 hours), so fetch the files straight away and call again for fresh links later. No credit charge for ads fetched recently. An ad whose cached links have gone stale is refetched by id at 0.5 credit per ad. If the links would make the response too large, the rest are listed under not_returned: pass those refs in a second call. Google video ads return a YouTube link, not a file. Meta files are the ad library's delivery copies (resized image, standard-definition video), not the advertiser's originals.

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": {
      "ads": "<ads>"
    },
    "name": "get_ad_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
adsYesUp to 20 ad refs copied from earlier tool output: Meta {ad_id, page_id}, Google {ad_url}, LinkedIn {linkedin_id}, TikTok {tiktok_id}. Other fields are ignored.
contextNoOne plain sentence, 8-20 words, starting with a verb, stating what the user is trying to accomplish in this conversation. Name the brand, competitor, industry, or topic involved. Reuse the exact same sentence on every tool call in this conversation. Never include people's names, emails, phone numbers, credentials, or internal company details. Never describe this tool or why it was chosen. Example: 'Compare Notion and Coda Meta ads to find hooks for a productivity app launch.'
conversation_idNoThe conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / conversation_id / description
      Previous value: -"Echo the conversation_id from the server's previous response. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it."New value: +"The conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics."
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, the description discloses plan gating (Free returns a note), signed link expiry with platform-specific windows (Meta days, TikTok ~6 hours), the credit model (no charge for recent ads, 0.5 credit per stale refetch), response-size truncation via not_returned, unresolved-ref handling, and a fidelity caveat that Meta files are ad-library delivery copies rather than originals. These are exactly the operational facts an agent cannot get from the schema or annotations.

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?

It is front-loaded with purpose and the when-to-use trigger before edge cases, and nearly every sentence carries operational information (expiry, credits, truncation, format caveats). It loses a little to length and to repeating the per-platform ref shapes that the schema already documents verbatim.

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?

With no output schema, the description carries the return contract itself and does so thoroughly: per-ad image/video URL including all carousel slides, media type, brand, suggested filename, clickable download_url, expiry note, and unresolved list. Combined with the size-truncation and platform-quirk notes, an agent has everything needed to call it and interpret the result.

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?

Schema coverage is 100% and the ads parameter description already spells out the per-platform ref shapes, so the description's restatement of Meta/Google/LinkedIn/TikTok ref formats is largely redundant. It does add one useful semantic detail for the ads array — that truncated refs should be passed back as a second call — but adds nothing for context or conversation_id beyond the schema text.

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: 'Get direct download links for ad creatives,' then states the concrete end goal (save files or push into own storage). This distinguishes it clearly from the detail-oriented siblings like get_meta_ads and get_meta_ad_details, which surface ad content rather than downloadable media.

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 an explicit trigger set: 'when the user asks to download, save, export or archive ads,' which is a strong when-to-use signal. It also implicitly states a prerequisite by requiring refs 'copied from earlier tool output,' but it never names an alternative or tells the agent which search/detail tool to run first to obtain those refs.

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