Skip to main content
Glama

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds some context by describing the return format and default values, but it lacks details on permissions, rate limits, or error handling. This is adequate but has clear gaps for a tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the purpose, followed by args and returns in a structured format. Every sentence adds value, but it could be slightly more concise by integrating the args and returns more seamlessly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity, no annotations, and an output schema exists (so return values are covered), the description is fairly complete. It covers purpose, parameters, and return format, but could improve by adding more behavioral context or usage guidelines.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It explains both parameters: 'access_token' as optional with caching behavior and 'limit' with its default value. This adds meaningful semantics beyond the bare schema, though it could detail format constraints or usage examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Get all available behavior targeting options,' which is a specific verb+resource combination. However, it doesn't explicitly distinguish this from sibling tools like 'search_interests' or 'search_demographics,' which are similar search tools in the same domain, so it misses full sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools or contexts where this tool is preferred, such as for behavior targeting specifically, leaving the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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