Skip to main content
Glama

delete_ad

Delete a specific ad by providing its ad ID. This action permanently removes the ad and cannot be undone.

Instructions

Delete an ad. This action is irreversible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_idYesAd ID to delete

Implementation Reference

  • The 'delete_ad' tool handler function. It accepts an 'ad_id' string parameter, calls client.delete with the ad ID, and returns the result with a success indicator.
    // ─── delete_ad ─────────────────────────────────────────────
    server.tool(
      "delete_ad",
      "Delete an ad. This action is irreversible.",
      {
        ad_id: z.string().describe("Ad ID to delete"),
      },
      async ({ ad_id }) => {
        try {
          const { data, rateLimit } = await client.delete(`/${ad_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 input schema for 'delete_ad': requires a single string parameter 'ad_id' described as 'Ad ID to delete'.
    {
      ad_id: z.string().describe("Ad ID to delete"),
    },
  • Registration of the 'delete_ad' tool via server.tool() call, with name 'delete_ad', description 'Delete an ad. This action is irreversible.', and the handler function.
    server.tool(
      "delete_ad",
      "Delete an ad. This action is irreversible.",
      {
        ad_id: z.string().describe("Ad ID to delete"),
      },
      async ({ ad_id }) => {
        try {
          const { data, rateLimit } = await client.delete(`/${ad_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/index.ts:52-52 (registration)
    Registration call: registerAdTools(server, client) which sets up the 'delete_ad' tool among other ad tools.
    registerAdTools(server, client);
  • The AdsClient.delete() method used by the 'delete_ad' handler to issue the HTTP DELETE request to the Meta Ads API.
    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, the description only notes irreversibility. Missing info on permissions, side effects (e.g., impact on campaigns), or required state (e.g., ad must be paused).

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?

Two sentences, no redundancy. Front-loads the action and adds critical irreversibility info efficiently.

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?

Simple delete tool with one parameter, but lacks details on errors, prerequisites, or return values. Adequate for basic use but could be more helpful with examples or caveats.

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 description covers the ad_id parameter fully (100% coverage). The tool description adds no additional meaning, 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 clearly states the verb 'delete' and the resource 'ad', differentiating it from siblings like create_ad and update_ad. It also adds the irreversible nature.

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 on when to use this tool versus alternatives (e.g., delete_adset, delete_campaign). Only mentions irreversibility but lacks prerequisites or conditions.

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