search_behaviors
Retrieve behavior targeting options for Meta Ads campaigns, including IDs, names, audience sizes, paths, and descriptions, using an access token and customizable result limit.
Instructions
Get all available behavior targeting options.
Args:
access_token: Meta API access token (optional - will use cached token if not provided)
limit: Maximum number of results to return (default: 50)
Returns:
JSON string containing behavior targeting options with id, name, audience_size bounds, path, and description
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| access_token | No | ||
| limit | No |
Implementation Reference
- meta_ads_mcp/core/targeting.py:454-476 (handler)The core handler function for the 'search_behaviors' MCP tool. Decorated with @mcp_server.tool() for registration and @meta_api_tool for API handling. Queries Meta Ads API search endpoint with parameters type='adTargetingCategory' and class='behaviors' to retrieve behavior targeting options.@mcp_server.tool() @meta_api_tool async def search_behaviors(access_token: Optional[str] = None, limit: int = 50) -> str: """ Get all available behavior targeting options. Args: access_token: Meta API access token (optional - will use cached token if not provided) limit: Maximum number of results to return (default: 50) Returns: JSON string containing behavior targeting options with id, name, audience_size bounds, path, and description """ endpoint = "search" params = { "type": "adTargetingCategory", "class": "behaviors", "limit": limit } data = await make_api_request(endpoint, access_token, params) return json.dumps(data, indent=2)
- meta_ads_mcp/core/__init__.py:14-14 (registration)Import of search_behaviors from targeting.py into core module, making it available for export and use.from .targeting import search_interests, get_interest_suggestions, estimate_audience_size, search_behaviors, search_demographics, search_geo_locations
- meta_ads_mcp/__init__.py:58-58 (registration)Re-export of search_behaviors at package level via import from core.search_behaviors,