search_behaviors
Retrieve behavior targeting options for Meta Ads campaigns to identify audience segments based on interests, activities, and purchase behaviors.
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 primary handler function for the 'search_behaviors' tool. Decorated with @mcp_server.tool() for MCP registration and @meta_api_tool for API handling. Makes a request to the Meta Ads 'search' endpoint with parameters for adTargetingCategory of class 'behaviors', returning JSON results.@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)