Meta Ads
Ad accounts, campaigns, ad sets, ads, creatives, insights and async reports, Lead Ads forms and leads (opt-in), agent pause/activate and capped budget changes after opt-in, creates and deletes node only
About
A Graphrt plugin for the Meta Marketing API (Facebook and Instagram ads on the Graph API, default version v27.0). It reads ad accounts, campaigns, ad sets, ads, creatives and insights (with synchronous and asynchronous reports), lists Lead Ads forms and their leads, and changes status and budgets. It is built with the declarative REST layer (definition.mjs) plus small agent-safety wrappers in lib/.
What it can do
- Accounts: list_ad_accounts (/me/adaccounts), get_ad_account (currency, time zone, spend, status)
- Structure: list_campaigns, list_ad_sets, list_ads, list_ad_creatives (with effective_status and filtering), get_campaign, get_ad_set, get_ad
- Insights: get_insights (fields, date_preset or time_range, time_increment, level, breakdowns, action_breakdowns, attribution windows, filtering, sort), run_insights_report (async report run for large ranges, waits until Job Completed), get_insights_report_rows (paginated rows of a finished run)
- Lead Ads: list_lead_forms (Instant Forms of a Page), list_leads (leads of a form or an ad, filtered by time_created)
- Changes: set_status (ACTIVE / PAUSED), set_budget (daily or lifetime budget of a campaign or ad set)
- Node only: create_campaign, create_ad_set, create_ad_creative, create_ad (all PAUSED by default, execution_options: ["validate_only"] to dry-run), delete_object
- api_request: any other Graph endpoint (GET only and allowlisted paths for agents), e.g. /act_<id>/adrules_library
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- List ad accounts
meta-ads.list_ad_accounts - Get ad account
meta-ads.get_ad_account - Campaigns
meta-ads.list_campaigns - Ad sets
meta-ads.list_ad_sets - Ads
meta-ads.list_ads - Ad creatives
meta-ads.list_ad_creatives - Get campaign
meta-ads.get_campaign - Get ad set
meta-ads.get_ad_set - Get ad
meta-ads.get_ad - Get insights
meta-ads.get_insights
Show all 22 actions
- Run async insights report
meta-ads.run_insights_report - Async insights report rows
meta-ads.get_insights_report_rows - List lead forms
meta-ads.list_lead_forms - List leads
meta-ads.list_leads - Pause or activate
meta-ads.set_status - Change budget
meta-ads.set_budget - Create campaign
meta-ads.create_campaign - Create ad set
meta-ads.create_ad_set - Create ad creative
meta-ads.create_ad_creative - Create ad
meta-ads.create_ad - Delete campaign, ad set or ad
meta-ads.delete_object - Meta Marketing API request
meta-ads.api_request
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
META_ADS_ACCESS_TOKENRequiredUser or (better) system user access token with the permissions below, sent as Authorization: Bearer -
META_GRAPH_VERSIONOptionalGraph API version, default v27.0 (shared with meta-api, e.g. v26.0) -
META_ADS_TOOL_ALLOW_WRITESOptional1 lets agent tools pause/activate (set_status) and change budgets (set_budget), see the two rows below -
META_ADS_TOOL_ACCOUNT_IDSFor any agent writeComma-separated ad accounts agents may change (act_123 or 123). Unset refuses every agent write -
META_ADS_TOOL_MAX_DAILY_BUDGETFor agent budget changes and activationsHighest budget an agent may set, or activate an object with, in the ad account currency's minor units. Unset or 0 refuses every agent budget change and activation -
META_ADS_TOOL_ALLOW_LEADSOptional1 lets agent tools read leads (form answers are personal data) -
META_ADS_TOOL_API_EXTRA_PATHSOptionalMore GET paths agents may reach with api_request, comma-separated, * = one segment -
META_ADS_TOOL_TOKEN_SOURCE
How to use it
In Graphrt Desktop
- Open Plugins and search for Meta Ads.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
$ graphrt plugin install meta-ads - id: report
type: meta-ads.run_insights_report
object_id: act_1234567890
level: ad
time_range: { since: "2026-01-01", until: "2026-10-31" }
breakdowns: [publisher_platform]
- id: rows
type: meta-ads.get_insights_report_rows
report_run_id: "{{#report.data.job_id#}}"
limit: 500
- id: pause
type: meta-ads.set_status
object_id: "120200000000001"
status: PAUSED
- id: budget
type: meta-ads.set_budget
object_id: "120200000000001"
daily_budget: 2000 # USD 20.00 on a USD account