Skip to main content
Glama

tiktok_ad_library_top_ads

TikTok Creative Center Top Ads — one ~20-row leaderboard page, not a library search (flat 2; ~1/ad on the fallback path). Costs 2 credits. Empty results and failures are never charged. Pass cache=true for a free 24h cache hit (default always fresh).

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

Input Schema

NameRequiredDescriptionDefault
qNoOptional keyword that ranks the one ~20-row leaderboard page — not a library search. Case-insensitive whole-word hits on title/brandName/industry/objective (hair ≠ wheelchair) come first; the rest of TikTok's keyword-ranked page follows as fill (matchedFrom [] on those ads, rankedFill in the envelope). There is no tags field. advertiser.name is often null in the default US market. Envelope candidatesScanned is the pre-filter pool size. For a known advertiser, use /tiktok/ad-details by ad id.
cacheNoSet true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh.
limitNoMax items to return (default 20, max 20). One Creative Center leaderboard page is ~20 rows; limit only trims that pool — it cannot scan more candidates. Flat 2 credits on the native path; the fallback path ~1 credit per returned ad (min 2).
matchNoKeyword token mode: "any" (default, OR) or "all" (AND). Zero whole-word hits still return TikTok's keyword-ranked page as matchBasis=ranked (literalMatches=0).
fieldsNoOptional comma-separated keys to keep on each result row (or on the object for single-item tools), e.g. id,url,publishedAt,engagement. Pagination keys are always kept. Does not change the price.
periodNoLookback window in days: 7, 30, or 180. Default 30.
compactNoDefault true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. On Threads, Facebook, Meta Ad Library and TikTok Shop tools request timings are dropped too. Pass false for the full body.
countryNoTwo-letter ISO country code. Default US. Non-ISO codes are a definitive 400 INVALID_COUNTRY (Creative Center used to quietly return an empty leaderboard for them).
orderByNoSort: for_you, likes, ctr, impressions, or cost. Default for_you.
adFormatNoOptional format filter: spark or non_spark. Served only by the extended fetcher — while it is disabled, adFormat returns 503 filter_unavailable (retryable false, not billed). Omit adFormat for the native leaderboard.
industryNoOptional industry key or label from Creative Center.
objectiveNoOptional campaign objective (e.g. Traffic, Conversion, Reach).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / compact / description
      Previous value: -"Default true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. Pass false for the full body."New value: +"Default true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. On Threads, Facebook, Meta Ad Library and TikTok Shop tools request timings are dropped too. Pass false for the full body."
  2. Changed2 schema fields changed
    • addedInput schema / properties / compact
      Added value: +{
      +  "default": true,
      +  "description": "Default true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. Pass false for the full body.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / fields
      Added value: +{
      +  "description": "Optional comma-separated keys to keep on each result row (or on the object for single-item tools), e.g. id,url,publishedAt,engagement. Pagination keys are always kept. Does not change the price.",
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • changedInput schema / properties / limit / description
      Previous value: -"Max items to return (default 20, max 20). One Creative Center leaderboard page is ~20 rows; limit only trims that pool — it cannot scan more candidates. Flat 2 credits on Decodo-native; Apify ~1 credit per returned ad (min 2)."New value: +"Max items to return (default 20, max 20). One Creative Center leaderboard page is ~20 rows; limit only trims that pool — it cannot scan more candidates. Flat 2 credits on the native path; the fallback path ~1 credit per returned ad (min 2)."
  4. Changed1 schema field changed
    • changedInput schema / properties / adFormat / description
      Previous value: -"Optional format filter: spark or non_spark."New value: +"Optional format filter: spark or non_spark. Served only by the extended fetcher — while it is disabled, adFormat returns 503 filter_unavailable (retryable false, not billed). Omit adFormat for the native leaderboard."
  5. Changed2 schema fields changed
    • changedInput schema / properties / country / description
      Previous value: -"Two-letter ISO country code. Default US."New value: +"Two-letter ISO country code. Default US. Non-ISO codes are a definitive 400 INVALID_COUNTRY (Creative Center used to quietly return an empty leaderboard for them)."
    • changedInput schema / properties / q / description
      Previous value: -"Optional keyword that filters the one ~20-row leaderboard page — not a library search. Case-insensitive whole-word match on title/brandName/industry/objective (hair ≠ wheelchair). There is no tags field. advertiser.name is often null in the default US market. Envelope candidatesScanned is the pre-filter pool size. For a known advertiser, use /tiktok/ad-details by ad id."New value: +"Optional keyword that ranks the one ~20-row leaderboard page — not a library search. Case-insensitive whole-word hits on title/brandName/industry/objective (hair ≠ wheelchair) come first; the rest of TikTok's keyword-ranked page follows as fill (matchedFrom [] on those ads, rankedFill in the envelope). There is no tags field. advertiser.name is often null in the default US market. Envelope candidatesScanned is the pre-filter pool size. For a known advertiser, use /tiktok/ad-details by ad id."
  6. Changed1 schema field changed
    • changedInput schema / properties / match / description
      Previous value: -"Keyword token mode: \"any\" (default, OR) or \"all\" (AND). Zero literal hits → empty ads[] (never an unfiltered soft list)."New value: +"Keyword token mode: \"any\" (default, OR) or \"all\" (AND). Zero whole-word hits still return TikTok's keyword-ranked page as matchBasis=ranked (literalMatches=0)."
  7. Changed1 schema field changed
    • changedInput schema / properties / cache / description
      Previous value: -"Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh. Envelope includes cached + cachedAt on hits."New value: +"Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh."
  8. Changed10 schema fields changed
    • changedInput schema / properties / adFormat / description
      Previous value: -"spark | non_spark."New value: +"Optional format filter: spark or non_spark."
    • changedInput schema / properties / cache / description
      Previous value: -"Serve from 24h cache when available (0 credits on hit)."New value: +"Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh. Envelope includes cached + cachedAt on hits."
    • changedInput schema / properties / country / description
      Previous value: -"ISO country code. Default US."New value: +"Two-letter ISO country code. Default US."
    • changedInput schema / properties / industry / description
      Previous value: -"Optional industry key or label."New value: +"Optional industry key or label from Creative Center."
    • changedInput schema / properties / limit / description
      Previous value: -"Max items (default 20, max 100). Flat 2 native; Apify ~1/ad (min 2)."New value: +"Max items to return (default 20, max 20). One Creative Center leaderboard page is ~20 rows; limit only trims that pool — it cannot scan more candidates. Flat 2 credits on Decodo-native; Apify ~1 credit per returned ad (min 2)."
    • changedInput schema / properties / match / description
      Previous value: -"Keyword mode: \"any\" (default) or \"all\"."New value: +"Keyword token mode: \"any\" (default, OR) or \"all\" (AND). Zero literal hits → empty ads[] (never an unfiltered soft list)."
    • changedInput schema / properties / objective / description
      Previous value: -"Optional campaign objective."New value: +"Optional campaign objective (e.g. Traffic, Conversion, Reach)."
    • changedInput schema / properties / orderBy / description
      Previous value: -"for_you | likes | ctr | impressions | cost."New value: +"Sort: for_you, likes, ctr, impressions, or cost. Default for_you."
    • changedInput schema / properties / period / description
      Previous value: -"Lookback days: 7, 30, or 180. Default 30."New value: +"Lookback window in days: 7, 30, or 180. Default 30."
    • changedInput schema / properties / q / description
      Previous value: -"Optional keyword (substring). See match + matchedFrom."New value: +"Optional keyword that filters the one ~20-row leaderboard page — not a library search. Case-insensitive whole-word match on title/brandName/industry/objective (hair ≠ wheelchair). There is no tags field. advertiser.name is often null in the default US market. Envelope candidatesScanned is the pre-filter pool size. For a known advertiser, use /tiktok/ad-details by ad id."
  9. Changed2 schema fields changed
    • changedInput schema / properties / cache / description
      Previous value: -"Set true to serve from the 24h response cache. Default false — always fetch fresh data."New value: +"Serve from 24h cache when available (0 credits on hit)."
    • changedInput schema / properties / limit / description
      Previous value: -"Max items to return. Default 20, max 100. Billed per result."New value: +"Max items (default 20, max 100). Flat 2 native; Apify ~1/ad (min 2)."
  10. Changed2 schema fields changed
    • addedInput schema / properties / match
      Added value: +{
      +  "description": "Keyword mode: \"any\" (default) or \"all\".",
      +  "type": "string"
      +}
    • changedInput schema / properties / q / description
      Previous value: -"Optional keyword filter."New value: +"Optional keyword (substring). See match + matchedFrom."
  11. Added

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so well: it states the flat 2-credit cost, the ~1/ad fallback pricing, that empty results and failures are never charged, and that cache=true yields a free 24h hit while the default is always-fresh. These are exactly the behavioral facts an agent needs before spending credits.

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 compact sentences, front-loaded with the resource identity and the critical non-search constraint before pricing and caching details. Parentheticals are dense ("flat 2; ~1/ad on the fallback path") but each earns its place; nothing is redundant padding.

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?

For a 12-parameter, no-annotation tool with no output schema, the description covers cost model, result-size ceiling, cache semantics, and billing exceptions. It leaves the envelope shape (matchBasis, rankedFill, candidatesScanned) to the schema, which is acceptable, though return-row structure is never described anywhere.

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 description coverage is 100%, so every one of the 12 parameters is already documented in the schema, including the ranked-fill behavior of q, the limit cap, and the match modes. The description adds only the cache/freshness nuance, which the schema also covers, so it lands at the baseline for a fully documented 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 opens with a specific verb+resource ("TikTok Creative Center Top Ads") and immediately bounds it: "one ~20-row leaderboard page, not a library search." That negative clause distinguishes it from the sibling tiktok_ad_library_search without the agent needing to open either schema.

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 clearly says what this tool is not (a library search) and gives a concrete routing hint via the parenthetical pricing note on the fallback path, plus a cache=true condition for free hits. It stops short of explicitly naming the alternative sibling to use for advertiser-scoped lookups, so the agent must infer the redirect from the schema text rather than the description itself.

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.