Skip to main content
Glama

delete_campaign

Permanently remove a campaign by providing its campaign ID. This action is irreversible and cannot be undone.

Instructions

Delete a campaign. This action is irreversible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYesCampaign ID to delete

Implementation Reference

  • The delete_campaign tool is registered via server.tool() in the registerCampaignTools function. It takes a campaign_id string parameter and sends a DELETE request to the Meta Ads API.
    server.tool(
      "delete_campaign",
      "Delete a campaign. This action is irreversible.",
      {
        campaign_id: z.string().describe("Campaign ID to delete"),
      },
      async ({ campaign_id }) => {
        try {
          const { data, rateLimit } = await client.delete(`/${campaign_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 };
        }
      }
    );
  • The handler function that executes delete_campaign logic. Calls client.delete with the campaign_id and returns the API response as JSON text.
    async ({ campaign_id }) => {
      try {
        const { data, rateLimit } = await client.delete(`/${campaign_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 };
      }
    }
  • Zod schema for the delete_campaign tool input: requires a single campaign_id string.
    {
      campaign_id: z.string().describe("Campaign ID to delete"),
    },
  • The AdsClient.delete helper method used by the delete_campaign handler. Wraps the request method with HTTP DELETE.
    async delete(
      path: string,
      params?: Record<string, unknown>
    ): Promise<ClientResponse> {
      return this.request("DELETE", path, params);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses that the action is irreversible, which is a critical behavioral trait. However, with no annotations provided, it does not disclose other potential consequences like cascading deletion of associated adsets/ads or permission requirements. It covers the most obvious risk but leaves other behaviors unstated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is only two sentences, front-loaded with the verb and resource, and the second sentence about irreversibility adds meaningful value without waste. It is appropriately concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (one parameter, no output schema), and the description states its primary purpose and its irreversible nature. However, given the absence of annotations, it does not address potential side effects on related objects or expected response on success/failure, leaving some ambiguity for a destructive operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema includes a single required parameter `campaign_id` with a description, and the schema coverage is 100%. The tool description adds nothing about the parameter's meaning beyond what the schema already specifies, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the specific action ('Delete') and resource ('a campaign'), clearly distinguishing it from other campaign-related tools like get_campaign or update_campaign. The resource is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as update_campaign (to change status) or delete_adset. It lacks any contextual cues about prerequisites or when deletion is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools