Skip to main content
Glama
Mike25app

scaleforge-mcp-meta-ads

update_campaign

Update a Meta Ads campaign's mutable fields including name, status, daily/lifetime budget, and bid strategy. Pass only the fields you need to change.

Instructions

WRITE: Update any mutable field on a campaign (name, status, daily_budget, lifetime_budget, bid_strategy). Pass only the fields you want to change.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYes
nameNo
statusNo
daily_budgetNo
lifetime_budgetNo
bid_strategyNo
special_ad_categoriesNo

Implementation Reference

  • The handler destructures campaign_id from args and sends a POST request to the Meta Graph API with the remaining fields as the body, updating the campaign.
    handler: async (args) => {
      const { campaign_id, ...rest } = args;
      return metaPost(`/${String(campaign_id)}`, rest as Record<string, unknown>);
    },
  • Zod schema for the input: campaign_id (required string), and optional fields: name, status, daily_budget, lifetime_budget, bid_strategy, special_ad_categories.
    inputSchema: {
      campaign_id: z.string(),
      name: z.string().optional(),
      status: STATUS.optional(),
      daily_budget: z.number().int().positive().optional(),
      lifetime_budget: z.number().int().positive().optional(),
      bid_strategy: BID_STRATEGY.optional(),
      special_ad_categories: z.array(z.string()).optional(),
    },
  • src/index.ts:47-49 (registration)
    All tool arrays (including campaignTools containing update_campaign) are merged and registered via server.registerTool() in a loop.
    const allTools: ToolDef[] = [
      ...accountTools,
      ...campaignTools,
  • metaPost is the HTTP helper used by update_campaign's handler to POST to the Meta Graph API.
    export async function metaPost<T = unknown>(
      path: string,
      body: Record<string, unknown> = {},
    ): Promise<T> {
      const form = buildQuery(body);
      form.append("access_token", getCurrentToken());
      const url = `${META_API_BASE}${normalizePath(path)}`;
    
      const res = await fetch(url, {
        method: "POST",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        body: form.toString(),
      });
      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;
      return JSON.parse(raw) as T;
    }
  • ToolDef type used to define the update_campaign tool object structure.
    export interface ToolDef {
      name: string;
      description: string;
      inputSchema: Record<string, ZodTypeAny>;
      handler: (args: Record<string, unknown>) => Promise<unknown>;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It only signals 'WRITE' and mentions mutable fields, but lacks disclosure of permissions, idempotency, error handling, rate limits, or other behavioral traits.

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 a single, efficient sentence with no wasted words. It is front-loaded with 'WRITE:' to indicate the action, achieving high conciseness.

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

Completeness2/5

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

Given the tool has 7 parameters, no annotations, and many sibling tools, the description is too brief. It does not explain return values, error conditions, or full usage context, leaving gaps for an AI agent.

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 description lists the main mutable fields and clarifies that only desired fields need to be passed, adding meaning beyond the raw schema. However, it omits the 'special_ad_categories' parameter and provides no detail on enum values, which are already in the schema.

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

Purpose4/5

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

Description clearly states 'Update any mutable field on a campaign' with a list of specific fields, making the purpose obvious. However, it does not explicitly differentiate from sibling update tools like update_ad or update_adset, though the name and context provide sufficient distinction.

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 says 'Pass only the fields you want to change,' which is a basic guideline for partial updates. It does not provide when-to-use or when-not-to-use guidance, nor does it mention alternatives among siblings.

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