Skip to main content
Glama
hashcott

Meta Ads MCP Server

by hashcott

Get Meta Ad Sets by Campaign

meta_ads_get_adsets_by_campaign
Read-onlyIdempotent

Retrieve ad sets for a Meta campaign with filtering and pagination. Supports status filters, field selection, and pagination cursors.

Instructions

Retrieve all ad sets belonging to a specific Meta campaign with filtering and pagination.

Args:

  • campaign_id (string): Campaign ID, e.g., '23843xxxxx'

  • fields (string[]): Fields per ad set. Common: id, name, account_id, campaign_id, status, effective_status, daily_budget, lifetime_budget, budget_remaining, bid_amount, bid_strategy, billing_event, optimization_goal, targeting, start_time, end_time, created_time, updated_time, pacing_type, destination_type

  • effective_status (string[]): Filter by status: ACTIVE, PAUSED, DELETED, PENDING_REVIEW, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO, ARCHIVED, WITH_ISSUES

  • filtering (object[]): Additional filter objects, e.g., [{field: 'optimization_goal', operator: 'IN', value: ['OFFSITE_CONVERSIONS', 'VALUE']}]

  • limit (number): Results per page (1-100, default: 25)

  • after / before (string): Pagination cursors

  • date_format (string): Date format for response

Returns: Object with data (ad set array) and paging. Use meta_ads_fetch_pagination_url with paging.next for more results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYesCampaign ID, e.g., '23843xxxxx'
fieldsNoList of specific fields to retrieve. If omitted, default fields are returned
filteringNoList of filter objects. Each has 'field', 'operator', and 'value'. Example: [{field: 'spend', operator: 'GREATER_THAN', value: 50}]
effective_statusNoFilter by effective status. Options: ACTIVE, PAUSED, DELETED, PENDING_REVIEW, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO, CAMPAIGN_PAUSED, ARCHIVED, ADSET_PAUSED, IN_PROCESS, WITH_ISSUES
date_formatNoFormat for date fields in response. 'U' = Unix timestamp (seconds), 'Y-m-d H:i:s' = MySQL datetime. Default: ISO 8601
limitNoMaximum number of results to return per page (1-100, default: 25)
afterNoCursor for the next page of results, from response.paging.cursors.after
beforeNoCursor for the previous page of results, from response.paging.cursors.before
offsetNoAlternative pagination: number of results to skip
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true. The description adds transparency about pagination behavior and the return structure (data array and paging object), which is helpful beyond the 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 well-structured: it starts with a clear one-sentence summary, then lists parameters in a readable block. While the parameter list is long, it is necessary given the tool's complexity (9 parameters). No unnecessary sentences.

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?

Despite the absence of an output schema, the description explains the return format and pagination mechanism. It provides enough context for an agent to select and invoke the tool correctly, including how to get more results using a sibling tool.

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

Parameters4/5

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

Schema description coverage is 100%, so the schema fully documents parameters. However, the description adds value by providing common field examples, default values (e.g., limit default 25), and example filtering objects, which aids in understanding parameter usage.

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 that the tool retrieves all ad sets belonging to a specific campaign, with filtering and pagination. This distinguishes it from sibling tools like meta_ads_get_adsets_by_adaccount and meta_ads_get_adsets_by_ids.

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 description explains how to use pagination (referencing meta_ads_fetch_pagination_url) and provides parameter details, but it does not explicitly mention when to use this tool versus alternatives or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hashcott/meta-ads-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server