fb_campaign_insights

Pack: facebook_ads · Endpoint: https://gateway.pipeworx.io/facebook_ads/mcp

Get campaign performance metrics: impressions, clicks, spend, CTR, CPC, conversions, ROAS. Requires account_id and campaign_id.

Parameters

NameTypeRequiredDescription
campaign_idstringyesCampaign ID
date_presetstringnoDate preset (e.g., “today”, “yesterday”, “last_7d”, “last_30d”, “this_month”)
time_range_sincestringnoStart date YYYY-MM-DD (use instead of date_preset)
time_range_untilstringnoEnd date YYYY-MM-DD (use with time_range_since)
fieldsstringnoComma-separated metrics (default: “impressions,clicks,spend,ctr,cpc,cpm,reach,actions”)

Example call

Arguments

{
  "campaign_id": "120393847102340",
  "date_preset": "last_7d"
}

curl

curl -X POST https://gateway.pipeworx.io/facebook_ads/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fb_campaign_insights","arguments":{"campaign_id":"120393847102340","date_preset":"last_7d"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('fb_campaign_insights', {
  "campaign_id": "120393847102340",
  "date_preset": "last_7d"
});

More examples

{
  "campaign_id": "120393847102340",
  "time_range_since": "2024-01-01",
  "time_range_until": "2024-01-31",
  "fields": "impressions,clicks,spend,ctr,cpc,cpm,reach,actions,action_values"
}

Response shape

FieldTypeDescription
dataarrayPerformance metrics rows
pagingobjectPagination info
errorstringError code if connection failed
messagestringError message if connection failed
Full JSON Schema
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "description": "Performance metrics rows",
      "items": {
        "type": "object",
        "properties": {
          "impressions": {
            "type": "string",
            "description": "Total impressions"
          },
          "clicks": {
            "type": "string",
            "description": "Total clicks"
          },
          "spend": {
            "type": "string",
            "description": "Total spend in account currency"
          },
          "ctr": {
            "type": "string",
            "description": "Click-through rate percentage"
          },
          "cpc": {
            "type": "string",
            "description": "Cost per click"
          },
          "cpm": {
            "type": "string",
            "description": "Cost per thousand impressions"
          },
          "reach": {
            "type": "string",
            "description": "Unique people reached"
          },
          "actions": {
            "type": "array",
            "description": "Action breakdowns"
          },
          "date_start": {
            "type": "string",
            "description": "Start date YYYY-MM-DD"
          },
          "date_stop": {
            "type": "string",
            "description": "End date YYYY-MM-DD"
          }
        }
      }
    },
    "paging": {
      "type": "object",
      "description": "Pagination info",
      "properties": {
        "cursors": {
          "type": "object"
        },
        "next": {
          "type": "string"
        }
      }
    },
    "error": {
      "type": "string",
      "description": "Error code if connection failed"
    },
    "message": {
      "type": "string",
      "description": "Error message if connection failed"
    }
  }
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "facebook_ads": {
      "url": "https://gateway.pipeworx.io/facebook_ads/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026