Skip to main content
Glama
dhawalshah

meta-ads-mcp

get_activities_by_adset

Retrieve a Facebook ad set's change history, including budget, status, and targeting updates. Filter by date range or fields to audit account activity.

Instructions

Retrieves activities for a Facebook ad set.

This function accesses the Facebook Graph API to retrieve information about key updates to an ad set. By default, this API returns one week's data. Information returned includes status changes, budget updates, targeting changes, and more.

Args: adset_id (str): The ID of the ad set, e.g., '123456789'. fields (Optional[List[str]]): A list of specific fields to retrieve. If None, all available fields will be returned. Available fields include: - 'actor_id': ID of the user who made the change - 'actor_name': Name of the user who made the change - 'application_id': ID of the application used to make the change - 'application_name': Name of the application used to make the change - 'changed_data': Details about what was changed in JSON format - 'date_time_in_timezone': The timestamp in the account's timezone - 'event_time': The timestamp of when the event occurred - 'event_type': The specific type of change that was made (numeric code) - 'extra_data': Additional data related to the change in JSON format - 'object_id': ID of the object that was changed - 'object_name': Name of the object that was changed - 'object_type': Type of object being modified - 'translated_event_type': Human-readable description of the change made, examples include: 'adset created', 'adset budget updated', 'targeting updated', 'adset status changed', etc. limit (Optional[int]): Maximum number of activities to return per page. Default behavior returns a server-determined number of results. after (Optional[str]): Pagination cursor for the next page of results. Obtained from the 'paging.cursors.after' field in the previous response. before (Optional[str]): Pagination cursor for the previous page of results. Obtained from the 'paging.cursors.before' field in the previous response. time_range (Optional[Dict[str, str]]): A custom time range with 'since' and 'until' dates in 'YYYY-MM-DD' format. Example: {'since': '2023-01-01', 'until': '2023-01-31'} This parameter overrides the since/until parameters if both are provided. since (Optional[str]): Start date in YYYY-MM-DD format. Defines the beginning of the time range for returned activities. Ignored if 'time_range' is provided. until (Optional[str]): End date in YYYY-MM-DD format. Defines the end of the time range for returned activities. Ignored if 'time_range' is provided.

Returns: Dict: A dictionary containing the requested activities. The main results are in the 'data' list, and pagination info is in the 'paging' object. Each activity object contains information about who made the change, what was changed, when it occurred, and the specific details of the change.

Example: ```python # Get recent activities for an ad set with default one week of data activities = get_activities_by_adset( adset_id="123456789", fields=["event_time", "actor_name", "translated_event_type"] )

# Get all activities from a specific date range
dated_activities = get_activities_by_adset(
    adset_id="123456789",
    time_range={"since": "2023-01-01", "until": "2023-01-31"},
    fields=["event_time", "actor_name", "translated_event_type", "extra_data"]
)

# Paginate through activity results
paginated_activities = get_activities_by_adset(
    adset_id="123456789",
    limit=50,
    fields=["event_time", "actor_name", "translated_event_type"]
)
```

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterNo
limitNo
sinceNo
untilNo
beforeNo
fieldsNo
adset_idYes
time_rangeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations available, the description carries the full burden of behavioral disclosure. It explains the default time window, that time_range overrides since/until, how pagination cursors work, and what the response shape looks like. It does not mention authentication requirements or error behavior, but for a read-only retrieval tool the disclosed behaviors are substantive and adequate.

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 long but well-structured, opening with the purpose and default behavior, then using Args, Returns, and Example sections. The parameter documentation is detailed and the examples are useful. It is somewhat verbose due to the full field enumeration, but that content earns its place given zero schema-side descriptions.

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

Completeness5/5

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

Given the tool has 8 parameters, no schema description coverage, and no annotations, the description covers all necessary context: parameter semantics, default behavior, return structure, pagination, and usage examples. An agent has everything it needs to invoke the tool correctly, and the output schema covers the return type. No critical information is missing.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully document the parameters, and it does. Every parameter is explained with types, formats, examples, and relationships (e.g., time_range overrides since/until). The fields parameter even enumerates all available field names with descriptions, adding meaning far beyond the bare schema.

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

Purpose5/5

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

The first sentence states the specific action ('Retrieves activities') and resource ('Facebook ad set'), clearly distinguishing this from account-level or campaign-level activity tools like get_activities_by_adaccount. The scope is unambiguous, and the follow-up clarifies what kind of information is returned, leaving no doubt about the tool's purpose.

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

Usage Guidelines4/5

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

The description gives clear context on when to use this tool: it targets ad set activities and defaults to one week of data, with custom time ranges available. It does not explicitly name alternatives or when-not-to-use conditions, but the ad-set scoping and the sibling tool names make the usage context sufficiently clear.

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