Skip to content

feat(mcp): the ads tree defaults to depth=campaign and tells agents how to drill down - #92

Merged
Gintm merged 2 commits into
developfrom
claude/mcp-ads-tree-campaign-depth
Nov 12, 2026
Merged

Gintm merged 2 commits into
developfrom
claude/mcp-ads-tree-campaign-depth

Conversation

@Gintm

@Gintm Gintm commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Why

#91 set get_ad_tree to depth=adset. Measured on prod, at the MCP's 10 campaigns per page adset still goes well past the 80K cap on big accounts (about 600K chars), while campaign stays near 50K on the biggest one (a 20-campaign page: 6.48M full, 1.27M adset, 103K campaign). This commit was pushed to the #91 branch after that PR merged, so it lands here.

What

  • AGENT_DEPTHS: getAdTree defaults to campaign.
  • The depth description now tells agents how to go deeper: "pass adset with campaign_id for one campaign's ad sets, or ad for everything." Generated against the live spec, the tools compile.

🤖 Generated with Claude Code

Gintm and others added 2 commits November 12, 2026 13:45
…ow to drill down

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gintm

Gintm commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Review (code-review high --fix)

Finding Outcome
The hint said campaignId but the generated tool argument is campaign_id Fixed

QA

Check Result
Full suite 1774 passed
Generated against the live spec (with #8195 merged) compiles; get_ad_tree has depth = "campaign" and the drill-down hint
Post-deploy (pending, after the bot regenerates) get_ad_tree on mcp.zernio.com with the staff account returns campaigns only; get_ad_tree(depth="adset", campaign_id=...) returns that campaign's ad sets

Metrics (sizes from prod, 20-campaign page)

Account ad adset (#91) campaign (this PR)
Typical 758K 103K 37K
Biggest 6.48M 1.27M 103K

Expected: get_ad_tree responses fit under the 80K cap at the default 10 campaigns on every measured account. Post-deploy: the Sentry returned-chars p95 for get_ad_tree, 24 h before and after, with get_analytics as control.

🤖 Generated with Claude Code

@Gintm
Gintm merged commit 37e63d4 into develop Nov 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant