Skip to main content
Glama
Mike25app

scaleforge-mcp-meta-ads

update_adset

Update specified mutable fields on a Meta Ads ad set, such as status, bid amount, daily budget, targeting, or name. Pass only the fields to change.

Instructions

WRITE: Update any mutable field on an ad set (status, bid_amount, daily_budget, targeting, name, etc.). Pass only the fields you want to change.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
adset_idYes
nameNo
statusNo
bid_amountNo
daily_budgetNo
lifetime_budgetNo
targetingNo
optimization_goalNo
billing_eventNo
start_timeNo
end_timeNo

Implementation Reference

  • The handler function for update_adset. It destructures adset_id from args, and POSTs the remaining fields to `/{adset_id}` via metaPost, sending only the fields to be updated.
    handler: async (args) => {
      const { adset_id, ...rest } = args;
      return metaPost(`/${String(adset_id)}`, rest as Record<string, unknown>);
    },
  • Input schema for update_adset: requires adset_id (string), and accepts optional fields: name, status (enum ACTIVE/PAUSED/DELETED/ARCHIVED), bid_amount, daily_budget, lifetime_budget, targeting, optimization_goal, billing_event, start_time, end_time.
    inputSchema: {
      adset_id: z.string(),
      name: z.string().optional(),
      status: STATUS.optional(),
      bid_amount: z.number().int().positive().optional(),
      daily_budget: z.number().int().positive().optional(),
      lifetime_budget: z.number().int().positive().optional(),
      targeting: z.record(z.unknown()).optional(),
      optimization_goal: OPTIMIZATION_GOAL.optional(),
      billing_event: BILLING_EVENT.optional(),
      start_time: z.string().optional(),
      end_time: z.string().optional(),
    },
  • The tool definition object for update_adset within the adsetTools array, with name 'update_adset', description, inputSchema, and handler.
    {
      name: "update_adset",
      description:
        "WRITE: Update any mutable field on an ad set (status, bid_amount, daily_budget, " +
        "targeting, name, etc.). Pass only the fields you want to change.",
      inputSchema: {
        adset_id: z.string(),
        name: z.string().optional(),
        status: STATUS.optional(),
        bid_amount: z.number().int().positive().optional(),
        daily_budget: z.number().int().positive().optional(),
        lifetime_budget: z.number().int().positive().optional(),
        targeting: z.record(z.unknown()).optional(),
        optimization_goal: OPTIMIZATION_GOAL.optional(),
        billing_event: BILLING_EVENT.optional(),
        start_time: z.string().optional(),
        end_time: z.string().optional(),
      },
      handler: async (args) => {
        const { adset_id, ...rest } = args;
        return metaPost(`/${String(adset_id)}`, rest as Record<string, unknown>);
      },
    },
  • src/index.ts:65-90 (registration)
    Where all tools (including adsetTools which contains update_adset) are registered on the MCP server via server.registerTool().
    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,
            };
          }
        },
      );
    }
  • The metaPost helper used by the update_adset handler to POST data 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;
    }
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It signals 'WRITE:' and says 'Update any mutable field,' but does not mention side effects, permissions, idempotency, rate limits, validation behavior, or what happens if invalid values are passed. For a mutation tool, this is insufficient.

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, front-loaded with 'WRITE:', no fluff. Every word contributes to clarity. Efficient and well-structured.

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?

With 11 parameters, no output schema, and no annotations, the description is too brief. It lacks return value information, error scenarios, required permissions, and guidance on when to use this over other update tools (e.g., update_bids_batch). Incomplete for a complex write operation.

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 coverage is 0%, so the description must compensate. It lists several parameter names (status, bid_amount, daily_budget, targeting, name) which adds context beyond the schema's property names. However, it does not explain format, constraints (e.g., currency units), or the meaning of 'targeting' object, and uses vague 'etc.'.

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 tool updates an ad set, lists specific mutable fields (status, bid_amount, etc.), and distinguishes from create_adset and delete_adset by explicitly saying 'Update' and mentioning pass-only-changed-fields.

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

Usage Guidelines4/5

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

The description provides a key usage instruction: 'Pass only the fields you want to change.' This implies partial updates. It does not explicitly exclude other tools like update_campaign, but the context of ad set versus campaign is clear. No when-not-to-use or alternative tools mentioned.

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