ghl_ad_fb_entity_get
Retrieve Facebook campaigns, ad sets, or ads for a location by entity type, with pagination to browse results.
Instructions
Get entities
Retrieve campaigns, ad sets, or ads for a location. entityType selects which, and each returns a { data } envelope whose item shape differs — the id key is campaignId, adSetId, or adId respectively, and the status fields differ too: campaigns carry both status and effectiveStatus, ad sets only effectiveStatus, and ads only status. next is returned only when the branch pages through Meta, so treat its absence as the end of the results rather than assuming a cursor. For CAMPAIGN, type=INTEGRATION queries Meta while type=AD_MANAGER reads campaigns this service published, filtered to PAUSED and PUBLISHED. ADSET requires campaignId; AD accepts adSetId for a single ad set or campaignId to page across the campaign.
Endpoint: GET /ad-publishing/facebook/entity (Version header: v3; source: v3/ad-publishing-v3.json)
OAuth scopes: adPublishing.readonly
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"locationId": "<locationId>",
"type": "<type>",
"entityType": "<entityType>"
},
"name": "ghl_ad_fb_entity_get"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| next | No | Pagination cursor | |
| type | Yes | Integration source type | |
| adSetId | No | Ad set identifier | |
| fetchAll | No | Fetch all entities | |
| searchId | No | Search identifier | |
| campaignId | No | Campaign identifier | |
| entityType | Yes | Entity type to fetch | |
| locationId | Yes | Location identifier | |
| selectedAdAccountId | No | Selected ad account ID |