Skip to main content
Glama

search_demographics

Retrieve demographic targeting options like life events, income, or family statuses for Meta Ads campaigns. Specify the demographic class and limit results to optimize ad audience selection and improve campaign performance.

Instructions

Get demographic targeting options. Args: access_token: Meta API access token (optional - will use cached token if not provided) demographic_class: Type of demographics to retrieve. Options: 'demographics', 'life_events', 'industries', 'income', 'family_statuses', 'user_device', 'user_os' (default: 'demographics') limit: Maximum number of results to return (default: 50) Returns: JSON string containing demographic targeting options with id, name, audience_size bounds, path, and description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
access_tokenNo
demographic_classNodemographics
limitNo

Implementation Reference

  • The core handler function for the 'search_demographics' tool. It searches Meta Ads API for demographic targeting options using the /search endpoint with adTargetingCategory type and specified class (default 'demographics'). Returns formatted JSON response.
    @mcp_server.tool() @meta_api_tool async def search_demographics(access_token: Optional[str] = None, demographic_class: str = "demographics", limit: int = 50) -> str: """ Get demographic targeting options. Args: access_token: Meta API access token (optional - will use cached token if not provided) demographic_class: Type of demographics to retrieve. Options: 'demographics', 'life_events', 'industries', 'income', 'family_statuses', 'user_device', 'user_os' (default: 'demographics') limit: Maximum number of results to return (default: 50) Returns: JSON string containing demographic targeting options with id, name, audience_size bounds, path, and description """ endpoint = "search" params = { "type": "adTargetingCategory", "class": demographic_class, "limit": limit } data = await make_api_request(endpoint, access_token, params) return json.dumps(data, indent=2)
  • Import statement that brings search_demographics into the core namespace, triggering registration via the @mcp_server.tool() decorator.
    from .targeting import search_interests, get_interest_suggestions, estimate_audience_size, search_behaviors, search_demographics, search_geo_locations
  • Re-export of search_demographics from core module at package level, making it available when importing the package.
    search_demographics,

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/pipeboard-co/meta-ads-mcp'

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