Skip to main content
Glama

Get Insights

adsap_get_insights

Retrieve aggregated spend and performance metrics for accounts, campaigns, ad sets, or ads over a date range. Served from ADSAP's insights cache and automatically refreshed live from Meta when the cache is missing or stale (>6h) — no dashboard visit required. Results / cost_per_result are objective-aware at every level (result_type per row names what a result is; 'multiple' when children mix; reach and ad recall fetched live). Parent filters campaign_ids (on adset/ad rows) and adset_ids (on ad rows) narrow the set server-side — sort, limit and summary then describe the filtered set; rows expose adset_id / campaign_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
cursorNo
date_toNoYYYY-MM-DD. Required if no date_preset.
metricsNoAny of: spend, impressions, clicks, link_clicks, outbound_clicks, conversions, purchase_conversions, lead_conversions, add_to_cart_conversions, conversion_value, purchase_value, video_views (=75% completion), video_thruplay, video_p25, video_p50, video_p75, video_p95, video_p100, lpv (landing page views), post_engagement, video_3s (3-sec plays), contact, checkout, registration, app_install, app_activation, subscribe, start_trial, view_content, add_payment_info, submit_application, add_to_wishlist, search, schedule, donate, find_location, customize_product, app_purchase, app_add_to_cart, app_initiate_checkout, app_add_payment_info, app_complete_registration, app_content_view, app_search, app_add_to_wishlist, app_level_achieved, app_achievement_unlocked, app_tutorial_completion, app_spent_credits, app_rate, subscribe_value (conversion value), start_trial_value (conversion value), ctr (link CTR), ctr_all, cpc (cost/link click), cpc_all, cpm, cost_per_conversion, purchase_roas, aov, conversion_rate, hook_rate, hold_rate, lpv_rate, cost_per_lpv, cost_per_lead, cost_per_atc, cost_per_thruplay, cost_per_post_engagement, cost_per_purchase, cost_per_subscribe, cost_per_start_trial, cost_per_view_content, cost_per_add_payment_info, cost_per_submit_application, cost_per_add_to_wishlist, cost_per_search, cost_per_schedule, cost_per_donate, cost_per_find_location, cost_per_customize_product, outbound_ctr, quality_ranking (ad level only, latest text value), engagement_rate_ranking (ad level only, latest text value), conversion_rate_ranking (ad level only, latest text value), results (objective-aware count at every level; the type is in result_type per row ('multiple' when children mix, then results is null and results_breakdown lists each type); reach / ad recall are fetched live per range), cost_per_result (spend/results (reach: per 1,000 people reached, Meta convention)). Also accepts custom-conversion refs: cc_<id> (count), cc_<id>_value (conversion value), cost_per_cc_<id> (spend/count), where <id> is the numeric custom conversion id from adsap_list_custom_conversions. Defaults to spend, impressions, link_clicks, ctr, cpc, cpm, results, cost_per_result, purchase_roas.
sort_byNo
group_byNo'entity': one aggregated row per campaign/ad set/ad across the whole date range (ratios correctly weighted from summed raws) — use for ranked tables. Omit for per-entity-per-day rows. Not valid with entity_type='account' (account is already a rollup and returns per-day rows).
sort_dirNo
adset_idsNoParent filter: keep only the ads in these ad sets (entity_type ad; to pick ad sets themselves use entity_ids). Composes with entity_ids and campaign_ids. Max 50.
date_fromNoYYYY-MM-DD. Required if no date_preset.
cache_modeNocache_only (never hit Meta) | cache_then_refresh (default — auto-refresh from Meta when cache is missing or stale) | force_refresh (always refresh from Meta first)
entity_idsNoFilter to specific IDs. Max 50.
date_presetNoRequired if no date_from/date_to
entity_typeYes
campaign_idsNoParent filter: keep only the ad sets / ads whose ad set belongs to one of these campaigns (entity_type adset or ad; to pick campaigns themselves use entity_ids). Mapping comes from the cached insight rows themselves (campaign_id stored with every ad-set / ad row, so deleted or archived ad sets stay linked) with the ad-set metadata cache (hourly) as fallback. Composes with entity_ids and adset_ids. Max 50.
ad_account_idYes
live_ad_recallersNoDeprecated: awareness results (reach, estimated ad recallers) are fetched live automatically wherever a row's result_type is a people count. Kept for compatibility: when true, estimated_ad_recallers is also attached to every row of the page (adds one Meta call).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well. It discloses that data is served from a cache, automatically refreshed from Meta when stale (>6h), that no dashboard visit is required, that results and cost_per_result are objective-aware, that reach and ad recall are fetched live, and that parent filters narrow the set server-side before sort/limit/summary. These are meaningful behavioral traits beyond the schema.

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?

The description is dense but well-structured: main purpose, caching/refresh behavior, metric semantics, then filter/ordering behavior. Each sentence earns its place and is front-loaded with the core action. For a tool with 16 parameters, this length is justified and information-dense without redundancy.

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?

The description is thorough for a complex tool with no annotations and no output schema. It covers caching, live refresh, objective-aware results, result_type behavior, and filter composition. Gaps remain: output structure, pagination via cursor, and the per-day vs per-entity row behavior for account-level queries are not described, though some are in the schema. Overall, it is near-complete but not exhaustive.

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?

Schema coverage is 63%, so the baseline is around 3, but the description adds valuable parameter semantics: it explains how campaign_ids and adset_ids act as parent filters, that rows expose adset_id/campaign_id, and that sort/limit/summary describe the filtered set. It also clarifies result_type semantics for rows. However, it does not compensate for undocumented parameters like cursor, sort_by, or date_to formatting.

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 a specific verb and resource: 'Retrieve aggregated spend and performance metrics for accounts, campaigns, ad sets, or ads over a date range.' This is unambiguous about what the tool does. However, it does not explicitly differentiate from the closely named sibling adsap_get_insights_breakdown, so the distinction is implied rather than stated.

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 first sentence provides clear context for when to use the tool: when aggregated metrics are needed for any of four entity types over a date range. It also explains behavior like caching and live refresh, but it does not explicitly mention alternatives such as adsap_get_insights_breakdown or state when not to use this tool. Clear context with no exclusions, but no explicit alternative routing.

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