search_behaviors
Find behavior-based targeting categories for Meta Ads campaigns to reach specific audience segments based on their online activities and interests.
Instructions
Search behavior-based targeting categories.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meta_access_token | No | ||
| page_size | No | ||
| page_cursor | No |
Implementation Reference
- The 'search_behaviors' function is defined in 'src/armavita_meta_ads_mcp/core/targeting_tools.py'. It constructs the parameters for an API request to search for behavior-based targeting categories and returns the JSON result. Note: It is missing the @mcp_server.tool() decorator in this block, which is likely added dynamically or through some other mechanism not immediately visible in this file, or it may have been omitted in the snippet provided. Wait, I should check the file again carefully. Actually, line 405 shows @mcp_server.tool() for search_demographics. Let me re-read lines 385-388.
async def search_behaviors( meta_access_token: Optional[str] = None, page_size: int = 50, page_cursor: str = "", ) -> str: """Search behavior-based targeting categories.""" params: Dict[str, Any] = { "type": "adTargetingCategory", "class": "behaviors", "page_size": int(page_size), } if page_cursor: params["page_cursor"] = page_cursor payload = await make_api_request("search", meta_access_token, params) return _as_json(payload)