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);
    }
Behavior2/5

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

With no annotations provided, the description must fully disclose behavioral traits. It only mentions irreversibility but omits critical details: whether child objects (ads, adsets) are cascaded, permission requirements, rate limits, or idempotency behavior. This is insufficient for a destructive operation.

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 two concise sentences, front-loading the action and key consequence. Every word is necessary; no fluff.

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?

For a simple delete with one parameter, the description is adequate but has gaps. It lacks information about error handling, expected side effects on related entities, and any conditions for the deletion to succeed. Given no output schema, more detail would improve completeness.

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?

Schema coverage is 100%, so baseline is 3. The description's 'Campaign ID to delete' adds no new meaning beyond the schema's 'Campaign ID to delete'. No additional format, constraints, or usage hints are provided.

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 explicitly states the verb 'Delete' and the resource 'campaign', clearly distinguishing it from siblings like create_campaign, update_campaign, and get_campaign. The phrase 'This action is irreversible' adds specific context about the operation's permanence.

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?

No guidance is given on when to use this tool versus alternatives (e.g., delete_ad, delete_adset), nor any prerequisites or side effects. The description is too minimal to help an agent decide between similar deletion operations.

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

Install Server

Other Tools

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/mikusnuz/meta-ads-mcp'

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