API Reference

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

ParameterTypeRequiredDescription
page_idstringYesPage Id
form_idsstringNoForm Ids
sincestringNoSince
untilstringNoUntil
page_access_tokenstringNoPage Access Token
save_dirstringNoSave Dir

Related Meta Ads tools

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:

Start using MCP Ads