Skip to main content
Glama

Metadata MCP Connector

Search Ads by Name

search_ads_by_names
Read-only

Search for ads by name in the Metadata platform library, with pagination.

               **USE THIS TOOL WHEN THE USER ASKS ABOUT:**
               - Ad details, information, or status
               - Finding an ad by name
               - Getting ad IDs
               - Checking if an ad exists
               - Looking up ad creative assets (images, thumbnails)
               - Ad type or channel information
               - Any question containing words like: "ad", "creative", "show me", "find", "search", "image"

               SEARCH FEATURES:
               - Partial, case-insensitive matching on ad names
               - Returns ad ID, name, channel type, ad type, status, and image URLs
               - Three-state status filter via the `status` param (default
                 `"active"`, preserves the prior active-only behaviour):
                   * `"active"`   → active ads only
                   * `"archived"` → archived (soft-deleted) ads only; use
                                    this to find an ad id for `unarchive_ad`
                   * `"all"`      → both active and archived in one response

               PAGINATION:
               - Supports `page` and `size` parameters (defaults: page=0, size=25).
               - Page numbering starts at 0.
               - Recommended size: 5-25 to keep responses LLM-friendly. Use up
                 to 100 only when the caller needs a wider sweep — large pages
                 can blow your context budget.
               - Returned `total_elements` and `total_pages` are taken from the
                 platform's PageResponse so callers can drive a paginator.
               - When `ad_names` carries multiple entries, the platform endpoint
                 accepts only ONE name per request — this tool fires one paged
                 request per name and merges results. `page`/`size` apply
                 PER-NAME, `total_elements` is the SUM across names, and
                 `total_pages` is the MAX across names. Single-name searches
                 get clean pagination semantics; multi-name is best-effort.

               PARAMETERS:
               - ad_names: Array of ad name strings to search for (required, ≥1)
               - page:     Zero-based page index (optional, default 0)
               - size:     Results per page (optional, default 25)
               - sort:     Spring sort clause (optional, default "createdDate,desc";
                           also valid: "id,desc", "name,asc", etc.)
               - status:   "active" (default) / "archived" / "all". Pick the
                           bucket you want; "archived" is the unarchive
                           discovery path, "all" is the rare both-buckets case.

               RETURNS:
               {
                   "found_ads": [
                       {
                           "id": 190084,
                           "name": "AI_Marketing_Audit_Q4_2025_Demo_LI_LI",
                           "channelType": "LINKEDIN",
                           "adType": "IMAGE",
                           "completionStatus": "COMPLETED",
                           "status": true,
                           "thumbnail": "https://...",
                           "imageUrl": "https://..."
                       }
                   ],
                   "missing_names": ["NonExistent"],
                   "total_found": 1,
                   "page": 0,
                   "size": 25,
                   "sort": "createdDate,desc",
                   "total_elements": 1,
                   "total_pages": 1
               }

               CHANNEL TYPES: LINKEDIN, FACEBOOK, INSTAGRAM, GOOGLE, REDDIT, MICROSOFT_ADS
               AD TYPES: IMAGE, VIDEO, CAROUSEL, TEXT
               STATUS: true (active) or false (inactive)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoZero-based page index (default: 0). Page numbering starts at 0.
sizeNoResults per page (default: 25, recommended max: 25). Larger windows blow LLM token budgets — only request more when the caller actually needs it.
sortNoSpring sort clause, e.g. 'createdDate,desc' (default), 'id,desc', or 'name,asc'.
statusNoWhich status bucket to return. 'active' (default) is the prior active-only behaviour. 'archived' returns ONLY archived (soft-deleted) ads, which is what you need to find an ad's id for unarchive_ad. 'all' returns both active and archived in one response. Maps to the platform's status query param semantics (Set<Boolean>): active=true, archived=false, all=omit.active
ad_namesYesArray of ad names or partial names to search for (case-insensitive, partial matching)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=false. The description adds substantial behavioral detail: pagination semantics (page starts at 0, size limits, context budget advice), status filter mapping to platform Set<Boolean> semantics, multi-name handling (per-name requests, merged results, sum/max for total_elements/total_pages), and the return structure. No contradictions with 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?

The description is long but well-structured with clear sections (USE THIS TOOL, SEARCH FEATURES, PAGINATION, PARAMETERS, RETURNS, CHANNEL TYPES). It front-loads the purpose and usage. While verbose, each section adds distinct value and avoids redundancy. Slightly over-lengthy but appropriately organized, so a 4.

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 compensates by providing a detailed RETURN example with field names and types, plus enumerations for channel types and ad types. It also explains edge cases (multi-name merging, status semantics, sort options). All necessary information for correct invocation is present, even for an agent unfamiliar with the platform.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description goes far beyond schema by adding: default values for page, size, sort, status; recommended size ranges (5-25, max 100); explanations of status enum meaning and platform mapping; multi-name pagination caveats; and a concrete return example with field types. This adds significant semantic value beyond the JSON 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 clearly states 'Search for ads by name in the Metadata platform library' and then enumerates specific user intents (ad details, finding by name, getting IDs, checking existence, creative assets, type/channel info). It distinguishes from sibling tools like search_campaigns_by_names and search_library_creatives_by_name by scoping to ads specifically.

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?

The description explicitly lists 'USE THIS TOOL WHEN THE USER ASKS ABOUT:' with concrete scenarios and even mentions trigger words. It does not explicitly name alternative tools, but it provides a clear decision framework for when this tool is appropriate. Missing explicit 'when not to use' guidance, hence a 4 rather than 5.

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