Get campaign tree
ads_get_treeReturn an ad account's campaigns, ad sets (TikTok ad groups, under the same adSets field) and ads, with spend and delivery metrics for the date range. For LinkedIn, campaigns are campaign groups, adSets are campaigns and ads are creatives. Meta trees come from a copy refreshed every few minutes (fetchedAt says when); reuse a result rather than asking again, and pass refresh only when the user says something just changed in Ads Manager.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"adAccountId": "<adAccountId>"
},
"name": "ads_get_tree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| since | No | YYYY-MM-DD. Give both since and until, or neither for the default range. | |
| until | No | YYYY-MM-DD, on or after since, at most 730 days later. | |
| refresh | No | Meta: re-read from Meta instead of Adeli's copy, at most once a minute. Only when the user says something just changed outside Adeli; Adeli's own changes already clear the copy. | |
| platform | No | meta_ads, tiktok_ads or linkedin_ads. Needed only when the profile has more than one ad network and no accountId is given. | |
| accountId | No | The Facebook accountId from list_accounts. Without it, pass profileId to use that profile's Facebook connection. | |
| profileId | No | A profileId from list_profiles. Optional when accountId is given, which names its profile; if both are given they must agree. | |
| adAccountId | Yes |