delete_audience
Remove a custom audience permanently. Delete outdated or unwanted audiences from your ad account with this irreversible action.
Instructions
Delete a custom audience. This action is irreversible.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audience_id | Yes | Audience ID to delete |
Implementation Reference
- src/tools/audiences.ts:108-123 (handler)The delete_audience tool handler: registers the tool with server.tool(), defines schema with audience_id param, and executes a DELETE request to /{audience_id}.
// ─── delete_audience ─────────────────────────────────────── server.tool( "delete_audience", "Delete a custom audience. This action is irreversible.", { audience_id: z.string().describe("Audience ID to delete"), }, async ({ audience_id }) => { try { const { data, rateLimit } = await client.delete(`/${audience_id}`); return { content: [{ type: "text" as const, text: JSON.stringify({ success: true, ...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:5-5 (registration)The registerAudienceTools function that wraps all audience tool registrations including delete_audience.
export function registerAudienceTools(server: McpServer, client: AdsClient): void { - src/index.ts:61-61 (registration)Where registerAudienceTools is called to register all audience tools (including delete_audience) on the MCP server.
registerAudienceTools(server, client);