Skip to main content
Glama

Get campaign tree

ads_get_tree
Read-only

Return 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.

Input Schema

NameRequiredDescriptionDefault
sinceNoYYYY-MM-DD. Give both since and until, or neither for the default range.
untilNoYYYY-MM-DD, on or after since, at most 730 days later.
platformNometa_ads or tiktok_ads. Needed only when the profile has both ad networks and no accountId is given.
accountIdNoThe Facebook accountId from list_accounts. Without it, pass profileId to use that profile's Facebook connection.
profileIdNoA profileId from list_profiles. Optional when accountId is given, which names its profile; if both are given they must agree.
adAccountIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / adAccountId / pattern
      Previous value: -"^act_\\d+$"New value: +"^(act_)?\\d+$"
    • addedInput schema / properties / platform
      Added value: +{
      +  "description": "meta_ads or tiktok_ads. Needed only when the profile has both ad networks and no accountId is given.",
      +  "enum": [
      +    "meta_ads",
      +    "tiktok_ads"
      +  ],
      +  "type": "string"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / accountId / description
      Previous value: -"The Facebook accountId from list_accounts. Defaults to the profile's Facebook connection."New value: +"The Facebook accountId from list_accounts. Without it, pass profileId to use that profile's Facebook connection."
    • changedInput schema / properties / profileId / description
      Previous value: -"Defaults to the profile your API key is bound to."New value: +"A profileId from list_profiles. Optional when accountId is given, which names its profile; if both are given they must agree."
  3. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered. The description adds that spend/delivery metrics for the date range are included, which is useful context, but says nothing about account-resolution behavior or response shape beyond annotations.

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

Conciseness5/5

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

A single well-formed sentence, front-loading the resource and hierarchy then the metrics, with zero wasted text.

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?

For a read-only tree tool with no output schema, the description adequately conveys what is returned (campaigns/ad sets/ads plus metrics). Account-resolution nuances are left to the schema, which is acceptable given high coverage.

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

Parameters3/5

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

Schema coverage is 83%, so the schema documents most parameters well, including the since/until range rules and platform/accountId/profileId resolution. The description adds nothing beyond that, so baseline 3 applies.

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?

States a specific verb ('Return') and the exact hierarchical resource set (campaigns, ad sets, ads) plus metrics. The 'tree' framing distinguishes it from ads_get_insights and ads_get_account, though it doesn't name those siblings explicitly.

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

Usage Guidelines3/5

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

Usage is implied by the tree-and-metrics output, but there is no explicit when-to-use guidance or routing to alternatives like ads_get_insights for flat metric queries. The agent must infer the selection.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources