Skip to main content
Glama

linkedin_ad_library_search_ads

LinkedIn publishes run dates, impressions and targeting only on a subset of creatives. Search is the SERP card; source is native. 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": "linkedin_ad_library_search_ads"
  }
}

Input Schema

NameRequiredDescriptionDefault
qNoAdvertiser / account owner name (min 2 when used). Provide q/company, keyword, or companyId.
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 200). One LinkedIn SERP page is ~25 cards — when limit is higher, further pages are pulled automatically within the request's time budget, so limit=50 fills to 50 when LinkedIn has the ads (hasMore + nextCursor cover the rest). Flat 2 credits per call on the native path; the extended fallback bills ~3.5 credits per returned ad. Response `source` is native or extended so you can see which price applied.
cursorNoPagination token from paginationToken / nextCursor.
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.
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.
companyNoAlias of q — advertiser / account owner name.
countryNoSingle ISO country code. Default US. Ignored when countries is set. Non-ISO codes are a definitive 400 INVALID_COUNTRY — LinkedIn would otherwise answer an empty result set as if the filter worked.
endDateNoCustom range end YYYY-MM-DD (use with startDate).
keywordNoOptional keyword filter on ad creative copy. Whole-word hits are ordered first; already-fetched SERP cards without a literal hit fill behind them up to limit (matchedFrom [] = ranked fill).
companyIdNoLinkedIn numeric company id for exact advertiser match.
countriesNoComma-separated ISO country codes (e.g. US,CA,MX). Each code is validated — non-ISO codes are a 400 INVALID_COUNTRY.
startDateNoCustom range start YYYY-MM-DD (use with endDate).
paginationTokenNoAlias of cursor.

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. Changed4 schema fields changed
    • changedInput schema / properties / countries / description
      Previous value: -"Comma-separated ISO country codes (e.g. US,CA,MX)."New value: +"Comma-separated ISO country codes (e.g. US,CA,MX). Each code is validated — non-ISO codes are a 400 INVALID_COUNTRY."
    • changedInput schema / properties / country / description
      Previous value: -"Single ISO country code. Default US. Ignored when countries is set."New value: +"Single ISO country code. Default US. Ignored when countries is set. Non-ISO codes are a definitive 400 INVALID_COUNTRY — LinkedIn would otherwise answer an empty result set as if the filter worked."
    • changedInput schema / properties / keyword / description
      Previous value: -"Optional keyword filter on ad creative copy."New value: +"Optional keyword filter on ad creative copy. Whole-word hits are ordered first; already-fetched SERP cards without a literal hit fill behind them up to limit (matchedFrom [] = ranked fill)."
    • changedInput schema / properties / limit / description
      Previous value: -"Max items to return (default 20, max 200). Flat 2 credits per call on the native path; the extended fallback bills ~3.5 credits per returned ad. Response `source` is native or extended so you can see which price applied."New value: +"Max items to return (default 20, max 200). One LinkedIn SERP page is ~25 cards — when limit is higher, further pages are pulled automatically within the request's time budget, so limit=50 fills to 50 when LinkedIn has the ads (hasMore + nextCursor cover the rest). Flat 2 credits per call on the native path; the extended fallback bills ~3.5 credits per returned ad. Response `source` is native or extended so you can see which price applied."
  4. 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."
  5. Changed12 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: +"Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh. Envelope includes cached + cachedAt on hits."
    • addedInput schema / properties / company
      Added value: +{
      +  "description": "Alias of q — advertiser / account owner name.",
      +  "type": "string"
      +}
    • changedInput schema / properties / companyId / description
      Previous value: -"LinkedIn numeric company id."New value: +"LinkedIn numeric company id for exact advertiser match."
    • changedInput schema / properties / countries / description
      Previous value: -"Comma-separated ISO codes (e.g. US,CA,MX)."New value: +"Comma-separated ISO country codes (e.g. US,CA,MX)."
    • changedInput schema / properties / country / description
      Previous value: -"ISO country code. Default US."New value: +"Single ISO country code. Default US. Ignored when countries is set."
    • changedInput schema / properties / cursor / description
      Previous value: -"Pagination token from nextCursor/paginationToken."New value: +"Pagination token from paginationToken / nextCursor."
    • changedInput schema / properties / endDate / description
      Previous value: -"YYYY-MM-DD custom range end (with startDate)."New value: +"Custom range end YYYY-MM-DD (use with startDate)."
    • changedInput schema / properties / keyword / description
      Previous value: -"Optional keyword filter on ad copy."New value: +"Optional keyword filter on ad creative copy."
    • changedInput schema / properties / limit / description
      Previous value: -"Max items to return (default 20, max 200). Flat 2 credits on the native path; the extended fallback bills ~3.5 credits per returned ad. Response `source` is native or extended."New value: +"Max items to return (default 20, max 200). Flat 2 credits per call on the native path; the extended fallback bills ~3.5 credits per returned ad. Response `source` is native or extended so you can see which price applied."
    • addedInput schema / properties / paginationToken
      Added value: +{
      +  "description": "Alias of cursor.",
      +  "type": "string"
      +}
    • changedInput schema / properties / q / description
      Previous value: -"Advertiser / account owner (min 2 when used). Or use keyword/companyId."New value: +"Advertiser / account owner name (min 2 when used). Provide q/company, keyword, or companyId."
    • changedInput schema / properties / startDate / description
      Previous value: -"YYYY-MM-DD custom range start (with endDate)."New value: +"Custom range start YYYY-MM-DD (use with endDate)."
  6. Changed1 schema field changed
    • changedInput schema / properties / limit / description
      Previous value: -"Max items to return. Default 20, max 200. Billed per result."New value: +"Max items to return (default 20, max 200). Flat 2 credits on the native path; the extended fallback bills ~3.5 credits per returned ad. Response `source` is native or extended."
  7. Changed8 schema fields changed
    • addedInput schema / properties / companyId
      Added value: +{
      +  "description": "LinkedIn numeric company id.",
      +  "type": "string"
      +}
    • addedInput schema / properties / countries
      Added value: +{
      +  "description": "Comma-separated ISO codes (e.g. US,CA,MX).",
      +  "type": "string"
      +}
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Pagination token from nextCursor/paginationToken.",
      +  "type": "string"
      +}
    • addedInput schema / properties / endDate
      Added value: +{
      +  "description": "YYYY-MM-DD custom range end (with startDate).",
      +  "type": "string"
      +}
    • addedInput schema / properties / keyword
      Added value: +{
      +  "description": "Optional keyword filter on ad copy.",
      +  "type": "string"
      +}
    • changedInput schema / properties / q / description
      Previous value: -"Search query or keywords (min 2 chars)."New value: +"Advertiser / account owner (min 2 when used). Or use keyword/companyId."
    • addedInput schema / properties / startDate
      Added value: +{
      +  "description": "YYYY-MM-DD custom range start (with endDate).",
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "q"
      -]
  8. Changed1 schema field changed
    • changedInput schema / properties / cache / description
      Previous value: -"Responses are cached for 24 hours by default. Set false to bypass the cache and always fetch fresh data (default true)."New value: +"Set true to serve from the 24h response cache. Default false — always fetch fresh data."
  9. Changed1 schema field changed
    • addedInput schema / properties / cache
      Added value: +{
      +  "description": "Responses are cached for 24 hours by default. Set false to bypass the cache and always fetch fresh data (default true).",
      +  "type": "boolean"
      +}
  10. Added

TDQS

B3/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and does deliver real behavioral facts: 2 credits per call, empty results and failures are never charged, a free 24h cache path exists and defaults to fresh, and coverage of run dates/impressions/targeting is only partial across creatives. That last point is genuinely valuable — it warns the agent the response will be sparse for some ads. It stops short of describing response shape, auth requirements, or the native-vs-extended fallback that the schema mentions.

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?

It is short and free of filler, but it is front-loaded with an obscure caveat instead of what the tool does, and the clauses are telegraphic ('Search is the SERP card; source is native'). The credit and cache facts are useful; the opening sentence is poorly ordered.

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 a 14-parameter tool with no annotations and no output schema, the description covers pricing, cache behavior, and partial data availability — meaningful coverage. However, it says nothing about what a result contains, how the native versus extended source and its different billing arise, or how this differs from ad_details, leaving real gaps for a tool of this 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% and the schema itself is unusually detailed (q/company aliasing, cache credits, limit pagination, country validation), so the schema does the heavy lifting. The description only adds meaning for the cache parameter, restating what the schema already says. Baseline 3 is appropriate.

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

Purpose3/5

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

The description never states a clear verb+resource; the reader must rely on the tool name to know this searches LinkedIn ad creatives. 'Search is the SERP card; source is native' is opaque jargon that gestures at list-level results versus detail-level siblings without saying so plainly. The most concrete content is a data-availability caveat, not a purpose statement.

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

Usage Guidelines2/5

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

There is no guidance on when to choose this over linkedin_ad_library_ad_details or the other ad-library search tools. The only actionable guidance is 'Pass cache=true for a free 24h cache hit,' which addresses a parameter choice rather than tool selection. An agent gets no exclusions, prerequisites, or alternative routing.

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.