Skip to main content
Glama
Mike25app

scaleforge-mcp-meta-ads

get_ad_insights

Pull performance metrics for a specific ad to compare creative effectiveness at the individual-ad level using breakdowns like age, gender, or platform.

Instructions

Pull performance metrics for ONE ad. Same fields/breakdowns as get_campaign_insights. Use this to compare creative performance at the individual-ad level.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_idYes
date_presetNoDefault last_7d
time_rangeNo{since:'YYYY-MM-DD', until:'YYYY-MM-DD'} — overrides date_preset
breakdownsNoe.g. ['age','gender'] or ['country','publisher_platform']
action_breakdownsNoe.g. ['action_type']
time_incrementNo1 = per-day rows, 7 = weekly, 'monthly', etc.
filteringNoMeta filtering spec
fieldsNoOverride default metric list
limitNo
afterNo

Implementation Reference

  • The handler function for get_ad_insights. It takes args containing an ad_id, constructs a Meta Graph API path /{ad_id}/insights, builds query params via insightsParams with level='ad', and makes a GET request via metaGet.
      handler: async (args) =>
        metaGet(`/${String(args.ad_id)}/insights`, insightsParams(args, "ad")),
    },
  • Input schema for get_ad_insights: requires ad_id (string) plus optional shared parameters like date_preset, time_range, breakdowns, action_breakdowns, time_increment, filtering, fields, limit, and after.
    inputSchema: {
      ad_id: z.string(),
      ...SHARED_INPUT_SCHEMA,
    },
  • The full tool definition for get_ad_insights registered as part of the insightsTools array exported from src/tools/insights.ts. This array is imported in both src/index.ts and src/http.ts and registered via McpServer.registerTool().
    {
      name: "get_ad_insights",
      description:
        "Pull performance metrics for ONE ad. Same fields/breakdowns as get_campaign_insights. " +
        "Use this to compare creative performance at the individual-ad level.",
      inputSchema: {
        ad_id: z.string(),
        ...SHARED_INPUT_SCHEMA,
      },
      handler: async (args) =>
        metaGet(`/${String(args.ad_id)}/insights`, insightsParams(args, "ad")),
    },
  • Helper function insightsParams builds query parameters for Meta insights API calls. It sets the level (e.g., 'ad'), joins fields array into comma-separated string, handles time_range vs date_preset, and conditionally adds breakdowns, action_breakdowns, time_increment, filtering, limit, and after.
    function insightsParams(args: Record<string, unknown>, level: string): Record<string, unknown> {
      const params: Record<string, unknown> = {
        level,
        fields: (args.fields as string[] | undefined)?.join(",") ?? DEFAULT_INSIGHTS_FIELDS,
      };
      if (args.time_range) params.time_range = args.time_range;
      else params.date_preset = args.date_preset ?? "last_7d";
    
      if (args.breakdowns) params.breakdowns = args.breakdowns;
      if (args.action_breakdowns) params.action_breakdowns = args.action_breakdowns;
      if (args.time_increment !== undefined) params.time_increment = args.time_increment;
      if (args.filtering) params.filtering = args.filtering;
      if (args.limit !== undefined) params.limit = args.limit;
      if (args.after) params.after = args.after;
      return params;
    }
  • Default fields constant used by insightsParams when no custom fields are provided.
    const DEFAULT_INSIGHTS_FIELDS =
      "spend,impressions,clicks,cpc,cpm,ctr,reach,frequency,actions,conversions,cost_per_conversion,cost_per_action_type,purchase_roas,video_30_sec_watched_actions,inline_link_clicks";
Behavior2/5

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

No annotations are provided, so the description must cover behavioral traits. It only states 'pull performance metrics,' which implies a read operation but does not disclose caching, rate limits, or other important behaviors.

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 two sentences, with the first stating the core purpose and the second providing usage guidance. No redundant information, extremely concise and front-loaded.

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

Completeness3/5

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

Given the tool has 10 parameters, no output schema, and is a read operation, the description covers core purpose and sibling comparison but lacks details on return format, pagination, or limits. It is minimally adequate.

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 description coverage is 70%, and the description adds no additional meaning beyond the schema. It neither explains nor contextualizes the parameters beyond their names and basic usage.

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 description explicitly states it pulls performance metrics for one ad, and distinguishes from get_campaign_insights by specifying individual-ad level comparison. This is specific and clear.

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 explicitly says to use this for comparing creative performance at the individual-ad level, implying when to use. It contrasts with campaign-level insights, but does not elaborate on when not to use or all alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mike25app/scaleforge-mcp-meta-ads'

If you have feedback or need assistance with the MCP directory API, please join our Discord server