Skip to main content
Glama
Mike25app

scaleforge-mcp-meta-ads

delete_adset

Hard-delete an ad set and its ads permanently. Consider archiving instead to retain historical data.

Instructions

WRITE: Hard-delete an ad set (and its ads). Prefer update_adset status=ARCHIVED to keep history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
adset_idYes

Implementation Reference

  • The 'delete_adset' tool handler — calls metaDelete() with the adset_id to hard-delete an ad set via the Meta Graph API. The handler is an async arrow function that takes args, extracts adset_id, and issues a DELETE request to /{adset_id}.
    {
      name: "delete_adset",
      description:
        "WRITE: Hard-delete an ad set (and its ads). Prefer update_adset status=ARCHIVED to keep history.",
      inputSchema: {
        adset_id: z.string(),
      },
      handler: async (args) => metaDelete(`/${String(args.adset_id)}`),
    },
  • Input schema for delete_adset — takes a single required string parameter 'adset_id' validated with Zod.
    inputSchema: {
      adset_id: z.string(),
  • src/index.ts:50-90 (registration)
    The adsetTools array (which contains delete_adset) is spread into allTools, then every tool is registered via server.registerTool() in the stdio entry point (src/index.ts).
      ...adsetTools,
      ...adTools,
      ...creativeTools,
      ...mediaTools,
      ...insightsTools,
      ...bulkTools,
      ...pageTools,
      ...adsLibraryTools,
    ];
    
    const server = new McpServer(
      { name: "mcp-meta-ads", version: "0.2.0" },
      { capabilities: { tools: {} } },
    );
    
    for (const tool of allTools) {
      server.registerTool(
        tool.name,
        {
          description: tool.description,
          inputSchema: tool.inputSchema,
        },
        // The SDK's ToolCallback type infers the arg shape from inputSchema, but
        // our shared ToolDef uses a generic Record<string, unknown> signature for
        // portability. The cast here is intentional and isolated to the bridge.
        async (args: unknown) => {
          try {
            const result = await tool.handler(args as Record<string, unknown>);
            return {
              content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
            };
          } catch (err) {
            const message = err instanceof Error ? err.message : String(err);
            return {
              content: [{ type: "text" as const, text: `Error: ${message}` }],
              isError: true,
            };
          }
        },
      );
    }
  • src/http.ts:33-41 (registration)
    Same adsetTools array is also registered in the HTTP entry point (src/http.ts), ensuring delete_adset works in both stdio and HTTP modes.
      ...adsetTools,
      ...adTools,
      ...creativeTools,
      ...mediaTools,
      ...insightsTools,
      ...bulkTools,
      ...pageTools,
      ...adsLibraryTools,
    ];
  • The metaDelete() function called by the delete_adset handler. Sends an HTTP DELETE request to the Meta Graph API with the access_token appended as a query parameter.
    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;
      }
    }
Behavior4/5

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

Despite no annotations, the description discloses the destructive nature ('hard-delete') and that ads are also deleted. It is fairly transparent for a delete operation, though could mention irreversibility.

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-loaded with the action, no wasted words. Structure is efficient and clear.

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?

For a simple one-parameter deletion tool, the description covers the core action and provides usage guidance. It does not explain return values, but that may be acceptable for a delete operation. Minor gap: no mention of idempotency or reversibility.

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

Parameters2/5

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

Schema description coverage is 0%, and the description adds no additional semantics beyond what the schema already provides for the 'adset_id' parameter. The parameter is not even explicitly mentioned.

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 set (and its ads)', using a specific verb and resource, and distinguishes itself from the sibling 'update_adset' tool by recommending an alternative.

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?

Explicitly advises to prefer 'update_adset status=ARCHIVED to keep history', providing a clear when-to-use vs. when-not-to-use recommendation with a specific 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