Meta Ads / API Reference
meta_ads_lead_export
Meta Ads tool. Export all leads from Facebook Lead Gen forms to CSV files (one per form). Fetches all forms for the page (or specific form IDs), reads all leads with pagination, and saves one CSV file per form as leads_{form_id}_{date}.csv. The CSV content is also returned inline for immediate use. Args: page_id: Facebook Page ID (required). form_ids: Comma-separated specific form IDs to export. Leave blank to fetch all forms on the page. since: Filter leads created after this value — Unix timestamp or YYYY-MM-DD. Optional. until: Filter leads created before this value — Unix timestamp or YYYY-MM-DD. Optional. page_access_token: Page access token. Leave blank to use META_ACCESS_TOKEN from .env. save_dir: Directory path to save CSV files. Defaults to current working directory.
This is a read-only tool: it returns lead export for your Meta Ads account. It changes nothing.
Ask Claude
You do not call this tool yourself. Ask for the outcome and the client picks the tool:
Lead export in my Meta Ads account for [page id].
It takes 1 required and 5 optional parameters.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page_id | string | Yes | Page Id |
form_ids | string | No | Form Ids |
since | string | No | Since |
until | string | No | Until |
page_access_token | string | No | Page Access Token |
save_dir | string | No | Save Dir |
Related Meta Ads tools
meta_ads_ab_test_resultsmeta_ads_account_change_historymeta_ads_account_diagnosticsmeta_ads_account_spending_limitmeta_ads_admeta_ads_ad_account
Before you can call it
This tool needs a connected Meta Ads account. The Meta Ads connect guide covers the OAuth flow and the permissions it asks for, and the quickstart gets a client talking to the server in about five minutes.
Workflows that use this
Rather than calling tools one at a time, these skills run a whole procedure against the same account: