Skip to main content
Glama

delete_meta_campaign

Permanently remove a Meta campaign and all associated ad sets and ads. This action cannot be undone, so use it to completely delete campaigns rather than temporarily pausing them.

Instructions

Permanently delete a Meta campaign and all its ad sets and ads. Cannot be undone. Use pause_meta_campaign to stop spending temporarily. Requires Starter plan or higher.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYesMeta campaign ID to permanently delete.

Implementation Reference

  • Handler logic for 'delete_meta_campaign' tool. It checks the license, validates the campaign_id, calls the helper `metaDelete` to perform the API request, and returns the success status.
    case 'delete_meta_campaign': {
        const denied = licenseCheck('meta');
        if (denied) return fail(denied);
        if (!args.campaign_id) return fail('campaign_id required.');
        await metaDelete(`/${args.campaign_id}`);
        return ok({ success: true, campaign_id: args.campaign_id, message: 'Campaign permanently deleted.' });
    }
  • MCP tool definition for 'delete_meta_campaign' including description and input schema.
        name: 'delete_meta_campaign',
        description: 'Permanently delete a Meta campaign and all its ad sets and ads. Cannot be undone. Use pause_meta_campaign to stop spending temporarily. Requires Starter plan or higher.',
        inputSchema: {
            type: 'object',
            properties: { campaign_id: { type: 'string', description: 'Meta campaign ID to permanently delete.' } },
            required: ['campaign_id'],
        },
    },
  • Helper function to perform DELETE requests against the Meta API. Used by the 'delete_meta_campaign' handler.
    async function metaDelete(path: string): Promise<MetaApiResponse> {
        const url = new URL(`${META_API}${path}`);
        url.searchParams.set('access_token', cfg.metaToken());
        const response = await fetch(url.toString(), { method: 'DELETE' });
        const json = await response.json() as MetaApiResponse;
        if (json.error) throw new Error(`Meta API: ${json.error.message} (code ${json.error.code})`);
        return json;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Nolas-Shadow/agent1st-ads-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server