Skip to main content
Glama
Mike25app

scaleforge-mcp-meta-ads

delete_ad

Permanently delete an ad by its ID. This action cannot be undone. To maintain ad history, use the update_ad tool to set status to ARCHIVED.

Instructions

WRITE: Hard-delete an ad. Prefer update_ad status=ARCHIVED to keep history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_idYes

Implementation Reference

  • The delete_ad tool handler. Accepts an ad_id, then calls metaDelete (HTTP DELETE) against Meta Graph API to hard-delete the ad.
    {
      name: "delete_ad",
      description:
        "WRITE: Hard-delete an ad. Prefer update_ad status=ARCHIVED to keep history.",
      inputSchema: {
        ad_id: z.string(),
      },
      handler: async (args) => metaDelete(`/${String(args.ad_id)}`),
    },
  • Input schema for delete_ad: requires a single string ad_id.
    inputSchema: {
      ad_id: z.string(),
    },
  • src/index.ts:47-58 (registration)
    delete_ad is registered via adTools array being spread into allTools, then the registration loop in index.ts calls server.registerTool for each tool.
    const allTools: ToolDef[] = [
      ...accountTools,
      ...campaignTools,
      ...adsetTools,
      ...adTools,
      ...creativeTools,
      ...mediaTools,
      ...insightsTools,
      ...bulkTools,
      ...pageTools,
      ...adsLibraryTools,
    ];
  • The metaDelete helper function that executes the actual HTTP DELETE request to the Meta Graph API with the access token appended.
    /**
     * DELETE a Graph API resource. Some endpoints return `{success: true}`, others
     * return empty bodies; we tolerate both.
     */
    export async function metaDelete<T = unknown>(path: string): Promise<T> {
      const qs = new URLSearchParams();
      qs.append("access_token", getCurrentToken());
      const url = `${META_API_BASE}${normalizePath(path)}?${qs.toString()}`;
    
      const res = await fetch(url, { method: "DELETE" });
      if (!res.ok) {
        const text = await res.text().catch(() => "");
        throw new Error(enhanceMetaError(res.status, text));
      }
      const raw = await res.text();
      if (!raw) return {} as T;
      try {
        return JSON.parse(raw) as T;
      } catch {
        return raw as unknown as T;
      }
    }
  • The ToolDef interface used to type the delete_ad definition (name, description, inputSchema, handler).
    export interface ToolDef {
      name: string;
      description: string;
      inputSchema: Record<string, ZodTypeAny>;
      handler: (args: Record<string, unknown>) => Promise<unknown>;
    }
Behavior4/5

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

No annotations are provided, but the description clearly states it's a hard-delete (irreversible write operation), which is sufficient for a simple tool.

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 concise sentences front-loading the action and providing usage guidance with no extra words.

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

Completeness4/5

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

Adequately covers purpose and usage for a simple delete tool with one parameter and no output schema, though could mention return behavior.

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 single parameter ad_id is self-explanatory from the tool name and description, but no additional semantic details are provided beyond the schema.

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 'Hard-delete an ad' with a specific verb and resource, distinguishing it from sibling tools like update_ad.

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

Usage Guidelines5/5

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

Provides explicit guidance: 'Prefer update_ad status=ARCHIVED to keep history' indicates when to use an alternative.

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

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