Skip to main content
Glama

Search TikTok Ad Library ads

tiktok_adLibrary_ads_search_get
Read-onlyIdempotent

Search the public TikTok Ads Library by keyword or advertiser name. Pass sortBy=last-shown for the most recently shown ads first. Optional inputs: query, advertiserName, advertiserBusinessId, country, startDate and 3 more. Returns a list (use cursor when paginated). Costs credits; see meta.creditsCharged.

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": {
      "context": "<context>",
      "llm_model": "<llm_model>"
    },
    "name": "tiktok_adLibrary_ads_search_get"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryNoKeyword to search the public TikTok Ads Library.
cursorNoOpaque pagination cursor from a previous response.
sortByNoOrder of the ads. `last-shown` lists the most recently shown ads first, by the day each ad was last shown: ads of an earlier day keep TikTok's order within that day, and today's ads are sorted by time within each page. When the full order isn't available, each page is still sorted by last-shown time, newest first, but not across pages; ads without a last-shown time come last. Results are TikTok's live data, so an ad shown again while you page can move. A page can be empty while `hasMore` is true; a page with no ads costs no credits. `relevance` (the default) is TikTok's own order for a keyword search. An advertiser search comes newest first either way; pass `last-shown` to have each page sorted when the full order isn't available.
contextYesDescribe the user's underlying goal in one sentence, not the tool you are calling.
countryNoCountry the ad was shown in (its targeting or delivery country, not the advertiser's). Case-insensitive. Omit it, or use `ALL`, for every supported country. The US isn't supported.
endDateNoOnly ads last shown on or before this date (UTC, YYYY-MM-DD, inclusive). Use with `startDate`.
llm_modelYesThe exact model identifier you (the assistant) are running as, taken from your system prompt or environment (for example "claude-opus-4-8" or "gpt-5.2"). Used for analytics only. If you do not know your model identifier with certainty, pass "unknown" and do not guess.
startDateNoOnly ads last shown on or after this date (UTC, YYYY-MM-DD). Use with `endDate`. Without both, the search covers the last 30 days. A narrower window means fewer pages to read.
advertiserNameNoSearch the public TikTok Ads Library by advertiser name.
conversation_idNoEcho 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.
advertiserBusinessIdNoTikTok advertiser business ID, from `advertiserMatches[].businessId` or an ad's `advertiserBusinessId`. Pins an advertiser search to that exact advertiser. Requires `advertiserName`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / sortBy / description
      Previous value: -"Order of the ads. `last-shown` lists the most recently shown ads first, by the day each ad was last shown: ads of an earlier day keep TikTok's order within that day, and today's ads are sorted by time within each page. When the full order isn't available, each page is still sorted by last-shown time, newest first, but not across pages; ads without a last-shown time come last. Results are TikTok's live data, so an ad shown again while you page can move. A page can be empty while `hasMore` is true; a page with no ads costs no credits. `relevance` (the default) is TikTok's own order for a keyword search. An advertiser search is always newest first."New value: +"Order of the ads. `last-shown` lists the most recently shown ads first, by the day each ad was last shown: ads of an earlier day keep TikTok's order within that day, and today's ads are sorted by time within each page. When the full order isn't available, each page is still sorted by last-shown time, newest first, but not across pages; ads without a last-shown time come last. Results are TikTok's live data, so an ad shown again while you page can move. A page can be empty while `hasMore` is true; a page with no ads costs no credits. `relevance` (the default) is TikTok's own order for a keyword search. An advertiser search comes newest first either way; pass `last-shown` to have each page sorted when the full order isn't available."
  2. Changed1 schema field changed
    • changedInput schema / properties / sortBy / description
      Previous value: -"Order of the ads. `last-shown` lists the most recently shown ads first, by the day each ad was last shown: ads of an earlier day keep TikTok's order within that day, and today's ads are sorted by time within each page. Results are TikTok's live data, so an ad shown again while you page can move. A page can be empty while `hasMore` is true; a page with no ads costs no credits. `relevance` (the default) is TikTok's own order for a keyword search. An advertiser search is always newest first."New value: +"Order of the ads. `last-shown` lists the most recently shown ads first, by the day each ad was last shown: ads of an earlier day keep TikTok's order within that day, and today's ads are sorted by time within each page. When the full order isn't available, each page is still sorted by last-shown time, newest first, but not across pages; ads without a last-shown time come last. Results are TikTok's live data, so an ad shown again while you page can move. A page can be empty while `hasMore` is true; a page with no ads costs no credits. `relevance` (the default) is TikTok's own order for a keyword search. An advertiser search is always newest first."
  3. Changed1 schema field changed
    • addedInput schema / properties / sortBy
      Added value: +{
      +  "description": "Order of the ads. `last-shown` lists the most recently shown ads first, by the day each ad was last shown: ads of an earlier day keep TikTok's order within that day, and today's ads are sorted by time within each page. Results are TikTok's live data, so an ad shown again while you page can move. A page can be empty while `hasMore` is true; a page with no ads costs no credits. `relevance` (the default) is TikTok's own order for a keyword search. An advertiser search is always newest first.",
      +  "enum": [
      +    "relevance",
      +    "last-shown"
      +  ],
      +  "type": "string"
      +}
  4. Changed16 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": [
      +        "string",
      +        "number",
      +        "boolean"
      +      ]
      +    },
      +    {
      +      "items": {
      +        "type": [
      +          "string",
      +          "number",
      +          "boolean"
      +        ]
      +      },
      +      "type": "array"
      +    }
      +  ]
      +}
    • addedInput schema / properties / advertiserBusinessId
      Added value: +{
      +  "description": "TikTok advertiser business ID, from `advertiserMatches[].businessId` or an ad's `advertiserBusinessId`. Pins an advertiser search to that exact advertiser. Requires `advertiserName`.",
      +  "pattern": "^\\d{1,32}$",
      +  "type": "string"
      +}
    • changedInput schema / properties / context / description
      Previous value: -"Describe the user's underlying goal in one sentence — not the tool you are calling."New value: +"Describe the user's underlying goal in one sentence, not the tool you are calling."
    • 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: +"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."
    • addedInput schema / properties / country
      Added value: +{
      +  "description": "Country the ad was shown in (its targeting or delivery country, not the advertiser's). Case-insensitive. Omit it, or use `ALL`, for every supported country. The US isn't supported.",
      +  "enum": [
      +    "ALL",
      +    "AT",
      +    "BE",
      +    "BG",
      +    "BR",
      +    "CH",
      +    "CY",
      +    "CZ",
      +    "DE",
      +    "DK",
      +    "EE",
      +    "ES",
      +    "FI",
      +    "FR",
      +    "GB",
      +    "GR",
      +    "HR",
      +    "HU",
      +    "IE",
      +    "IS",
      +    "IT",
      +    "LI",
      +    "LT",
      +    "LU",
      +    "LV",
      +    "MT",
      +    "NL",
      +    "NO",
      +    "PL",
      +    "PT",
      +    "RO",
      +    "SE",
      +    "SI",
      +    "SK",
      +    "TR"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / endDate
      Added value: +{
      +  "description": "Only ads last shown on or before this date (UTC, YYYY-MM-DD, inclusive). Use with `startDate`.",
      +  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      +  "type": "string"
      +}
    • removedInput schema / properties / keywords
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "boolean"
      -    }
      -  ],
      -  "description": "Alias for `query`. Prefer `query`."
      -}
    • removedInput schema / properties / limit
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "boolean"
      -    }
      -  ],
      -  "description": "Ignored if this tool does not support it."
      -}
    • changedInput schema / properties / llm_model / description
      Previous value: -"The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. \"claude-opus-4-8\", \"gpt-5.2\"). Used for analytics only. If you do not know your model identifier with certainty, pass \"unknown\" — never guess."New value: +"The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (for example \"claude-opus-4-8\" or \"gpt-5.2\"). Used for analytics only. If you do not know your model identifier with certainty, pass \"unknown\" and do not guess."
    • removedInput schema / properties / maxResults
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "boolean"
      -    }
      -  ],
      -  "description": "Ignored if this tool does not support it."
      -}
    • removedInput schema / properties / max_results
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "boolean"
      -    }
      -  ],
      -  "description": "Ignored if this tool does not support it."
      -}
    • removedInput schema / properties / offset
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "boolean"
      -    }
      -  ],
      -  "description": "Ignored if this tool does not support it."
      -}
    • removedInput schema / properties / pageSize
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "boolean"
      -    }
      -  ],
      -  "description": "Ignored if this tool does not support it."
      -}
    • removedInput schema / properties / q
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "boolean"
      -    }
      -  ],
      -  "description": "Alias for `query`. Prefer `query`."
      -}
    • addedInput schema / properties / startDate
      Added value: +{
      +  "description": "Only ads last shown on or after this date (UTC, YYYY-MM-DD). Use with `endDate`. Without both, the search covers the last 30 days. A narrower window means fewer pages to read.",
      +  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      +  "type": "string"
      +}
    • removedInput schema / properties / trim
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "boolean"
      -    }
      -  ],
      -  "description": "Ignored if this tool does not support it."
      -}
  5. Changed8 schema fields changed
    • addedInput schema / properties / keywords
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "boolean"
      +    }
      +  ],
      +  "description": "Alias for `query`. Prefer `query`."
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "boolean"
      +    }
      +  ],
      +  "description": "Ignored if this tool does not support it."
      +}
    • addedInput schema / properties / maxResults
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "boolean"
      +    }
      +  ],
      +  "description": "Ignored if this tool does not support it."
      +}
    • addedInput schema / properties / max_results
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "boolean"
      +    }
      +  ],
      +  "description": "Ignored if this tool does not support it."
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "boolean"
      +    }
      +  ],
      +  "description": "Ignored if this tool does not support it."
      +}
    • addedInput schema / properties / pageSize
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "boolean"
      +    }
      +  ],
      +  "description": "Ignored if this tool does not support it."
      +}
    • addedInput schema / properties / q
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "boolean"
      +    }
      +  ],
      +  "description": "Alias for `query`. Prefer `query`."
      +}
    • addedInput schema / properties / trim
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "boolean"
      +    }
      +  ],
      +  "description": "Ignored if this tool does not support it."
      +}
  6. Changed11 schema fields changed
    • removedInput schema / properties / adFormat
      Removed value: -{
      -  "description": "Ad format filter for Top Ads. `spark-ads`: ads boosted from an organic creator/brand TikTok post. `non-spark-ads`: ads uploaded directly as ad creative, not boosted from an existing post.",
      -  "enum": [
      -    "spark-ads",
      -    "non-spark-ads"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / adLanguage
      Removed value: -{
      -  "description": "Ad language filter for Top Ads.",
      -  "enum": [
      -    "en",
      -    "es",
      -    "ar",
      -    "vi",
      -    "th",
      -    "de",
      -    "id",
      -    "pt",
      -    "fr",
      -    "ms",
      -    "nl",
      -    "ja",
      -    "it",
      -    "ro",
      -    "zh-Hant",
      -    "ko"
      -  ],
      -  "type": "string"
      -}
    • changedInput schema / properties / advertiserName / description
      Previous value: -"Search the public TikTok Ads Library by advertiser name. When set, results come from the public Ads Library instead of Top Ads."New value: +"Search the public TikTok Ads Library by advertiser name."
    • removedInput schema / properties / duration
      Removed value: -{
      -  "description": "Video duration filter for Top Ads.",
      -  "enum": [
      -    "under-10s",
      -    "10-20s",
      -    "20-30s",
      -    "30-40s",
      -    "40-50s",
      -    "over-50s"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / industry
      Removed value: -{
      -  "description": "Industry filter for Top Ads.",
      -  "enum": [
      -    "apparel-accessories",
      -    "appliances",
      -    "apps",
      -    "baby-kids-maternity",
      -    "beauty-personal-care",
      -    "business-services",
      -    "ecommerce-non-app",
      -    "education",
      -    "financial-services",
      -    "food-beverage",
      -    "games",
      -    "health",
      -    "home-improvement",
      -    "household-products",
      -    "life-services",
      -    "news-entertainment",
      -    "pets",
      -    "sports-outdoor",
      -    "tech-electronics",
      -    "travel",
      -    "vehicle-transportation"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / likes
      Removed value: -{
      -  "description": "Likes percentile filter for Top Ads.",
      -  "enum": [
      -    "top-1-20",
      -    "top-21-40",
      -    "top-41-60",
      -    "top-61-80",
      -    "top-81-100"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / objective
      Removed value: -{
      -  "description": "Campaign objective filter for Top Ads.",
      -  "enum": [
      -    "app-installs",
      -    "conversions",
      -    "lead-generation",
      -    "product-sales",
      -    "reach",
      -    "traffic",
      -    "video-views"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / orderBy
      Removed value: -{
      -  "description": "Sort metric for Top Ads. `cvr`: conversion rate. `ctr`: click-through rate. `play-2s-rate`/`play-6s-rate`: rate viewers played past the 2s/6s mark. Default: `for-you`.",
      -  "enum": [
      -    "for-you",
      -    "impression",
      -    "play-2s-rate",
      -    "play-6s-rate",
      -    "cvr",
      -    "ctr",
      -    "like"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / period
      Removed value: -{
      -  "description": "Time window in days for Top Ads.",
      -  "enum": [
      -    "7",
      -    "30",
      -    "180"
      -  ],
      -  "type": "string"
      -}
    • changedInput schema / properties / query / description
      Previous value: -"Optional keyword to search ad titles and content."New value: +"Keyword to search the public TikTok Ads Library."
    • removedInput schema / properties / region
      Removed value: -{
      -  "description": "Country code for Top Ads results. Default: `US`.",
      -  "enum": [
      -    "DZ",
      -    "AR",
      -    "AU",
      -    "AT",
      -    "AZ",
      -    "BH",
      -    "BD",
      -    "BY",
      -    "BE",
      -    "BO",
      -    "BR",
      -    "BG",
      -    "KH",
      -    "CA",
      -    "CL",
      -    "CO",
      -    "CR",
      -    "HR",
      -    "CY",
      -    "CZ",
      -    "DK",
      -    "DO",
      -    "EC",
      -    "EG",
      -    "EE",
      -    "FI",
      -    "FR",
      -    "DE",
      -    "GR",
      -    "GT",
      -    "JO",
      -    "HU",
      -    "ID",
      -    "IQ",
      -    "IE",
      -    "IL",
      -    "IT",
      -    "JP",
      -    "KZ",
      -    "KE",
      -    "KW",
      -    "LV",
      -    "LB",
      -    "MY",
      -    "MX",
      -    "MA",
      -    "NL",
      -    "NZ",
      -    "NG",
      -    "NO",
      -    "OM",
      -    "PK",
      -    "PA",
      -    "PY",
      -    "PE",
      -    "PH",
      -    "PL",
      -    "PT",
      -    "PR",
      -    "QA",
      -    "LT",
      -    "RO",
      -    "SA",
      -    "RS",
      -    "SG",
      -    "SK",
      -    "SI",
      -    "ZA",
      -    "KR",
      -    "ES",
      -    "LK",
      -    "SE",
      -    "CH",
      -    "TW",
      -    "TH",
      -    "TR",
      -    "AE",
      -    "GB",
      -    "US",
      -    "UY",
      -    "VN"
      -  ],
      -  "type": "string"
      -}
  7. Changed5 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / context
      Added value: +{
      +  "description": "Describe the user's underlying goal in one sentence — not the tool you are calling.",
      +  "type": "string"
      +}
    • addedInput schema / properties / conversation_id
      Added value: +{
      +  "description": "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.",
      +  "type": "string"
      +}
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. \"claude-opus-4-8\", \"gpt-5.2\"). Used for analytics only. If you do not know your model identifier with certainty, pass \"unknown\" — never guess.",
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "context",
      +  "llm_model"
      +]
  8. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  9. Changed3 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / adFormat / description
      Previous value: -"Ad format filter for Top Ads."New value: +"Ad format filter for Top Ads. `spark-ads`: ads boosted from an organic creator/brand TikTok post. `non-spark-ads`: ads uploaded directly as ad creative, not boosted from an existing post."
    • changedInput schema / properties / orderBy / description
      Previous value: -"Sort metric for Top Ads. Default: `for-you`."New value: +"Sort metric for Top Ads. `cvr`: conversion rate. `ctr`: click-through rate. `play-2s-rate`/`play-6s-rate`: rate viewers played past the 2s/6s mark. Default: `for-you`."
  10. Changed2 schema fields changed
    • changedInput schema / properties / orderBy / description
      Previous value: -"Sort metric for Top Ads. Defaults to for-you when omitted."New value: +"Sort metric for Top Ads. Default: `for-you`."
    • changedInput schema / properties / region / description
      Previous value: -"Country code for Top Ads results. Defaults to US when omitted."New value: +"Country code for Top Ads results. Default: `US`."
  11. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description does add real value beyond that: it discloses that the call costs credits, points to `meta.creditsCharged`, and warns that results are paginated via cursor. It still omits the sequencing constraint that a conversation_id must be obtained before parallel calls, which is behaviorally significant.

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 short sentences, front-loaded with purpose, then a usage tip, then the input summary. The 'and 3 more' ellipsis is slightly imprecise and the sortBy advice duplicates the schema, but there is no fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter, credit-charging search with no output schema, the description does cover return shape and pagination. However it never mentions the required `context`/`llm_model` bookkeeping parameters, the conversation_id handshake that forbids parallel calls, or that advertiserBusinessId depends on advertiserName, leaving meaningful gaps relative to the tool's complexity.

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 the schema already carries the detail, including a far richer sortBy explanation than the description's one-line tip. The description enumerates a few optional input names and then truncates with 'and 3 more', which adds almost no meaning beyond structured data; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Search the public TikTok Ads Library') and names the two search modes, keyword and advertiser name, which clearly separates it from the single-ad lookup sibling tiktok_adLibrary_ad_get. It does not explicitly contrast itself with any sibling by name, so it lands just short of a 5.

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 only usage steering is 'Pass sortBy=last-shown for the most recently shown ads first', which is a parameter tip rather than when-to-use guidance. There is no explicit statement of when to prefer this over tiktok_adLibrary_ad_get or a platform-sibling search, though the search-by-keyword framing implies the use case adequately.

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.