get_audience_health
Check the health and delivery readiness of a custom audience. View match rate, audience size, and operation status.
Instructions
Get health status and delivery readiness of a custom audience. Shows match rate, size, and operation status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audience_id | Yes | Custom audience ID |
Implementation Reference
- src/tools/audiences.ts:186-203 (handler)Registration and handler for the 'get_audience_health' tool. Fetches health status (approximate count bounds, operation status, delivery status, permission for actions) of a custom audience by ID via the Meta API.
// ─── get_audience_health ──────────────────────────────────── server.tool( "get_audience_health", "Get health status and delivery readiness of a custom audience. Shows match rate, size, and operation status.", { audience_id: z.string().describe("Custom audience ID"), }, async ({ audience_id }) => { try { const { data, rateLimit } = await client.get(`/${audience_id}`, { fields: "id,name,approximate_count_lower_bound,approximate_count_upper_bound,operation_status,delivery_status,permission_for_actions", }); return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } ); - src/tools/audiences.ts:190-192 (schema)Input schema for get_audience_health: requires a single 'audience_id' string parameter.
{ audience_id: z.string().describe("Custom audience ID"), }, - src/tools/audiences.ts:187-203 (registration)Registration of the tool named 'get_audience_health' via server.tool() with description and handler.
server.tool( "get_audience_health", "Get health status and delivery readiness of a custom audience. Shows match rate, size, and operation status.", { audience_id: z.string().describe("Custom audience ID"), }, async ({ audience_id }) => { try { const { data, rateLimit } = await client.get(`/${audience_id}`, { fields: "id,name,approximate_count_lower_bound,approximate_count_upper_bound,operation_status,delivery_status,permission_for_actions", }); return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );