Skip to main content
Glama

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
NameRequiredDescriptionDefault
access_tokenNo
limitNo

Implementation Reference

  • 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)
  • 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
  • Re-export of search_behaviors at package level via import from core.
    search_behaviors,

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