Skip to main content
Glama

update_ad_account

Modify ad account name, timezone, or spend cap by providing only the fields to change.

Instructions

Update the configured ad account settings. Only provided fields will be modified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoNew account name
timezone_nameNoNew timezone (e.g. 'America/New_York')
spend_capNoAccount spend cap in currency cents (e.g. '100000' = $1000.00)

Implementation Reference

  • The async handler function that executes the update_ad_account tool logic. It collects optional parameters (name, timezone_name, spend_cap) and sends a POST request to the Meta Ads API using client.accountPath.
      async ({ name, timezone_name, spend_cap }) => {
        try {
          const params: Record<string, unknown> = {};
          if (name) params.name = name;
          if (timezone_name) params.timezone_name = timezone_name;
          if (spend_cap) params.spend_cap = spend_cap;
          const { data, rateLimit } = await client.post(`${client.accountPath}`, params);
          return { content: [{ type: "text" as const, text: JSON.stringify({ ...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 };
        }
      }
    );
  • Input schema for update_ad_account using Zod: name (optional string), timezone_name (optional string), spend_cap (optional string).
    {
      name: z.string().optional().describe("New account name"),
      timezone_name: z.string().optional().describe("New timezone (e.g. 'America/New_York')"),
      spend_cap: z.string().optional().describe("Account spend cap in currency cents (e.g. '100000' = $1000.00)"),
    },
  • Registration of the 'update_ad_account' tool on the MCP server via server.tool(), including its description and schema.
    server.tool(
      "update_ad_account",
      "Update the configured ad account settings. Only provided fields will be modified.",
      {
        name: z.string().optional().describe("New account name"),
        timezone_name: z.string().optional().describe("New timezone (e.g. 'America/New_York')"),
        spend_cap: z.string().optional().describe("Account spend cap in currency cents (e.g. '100000' = $1000.00)"),
      },
      async ({ name, timezone_name, spend_cap }) => {
        try {
          const params: Record<string, unknown> = {};
          if (name) params.name = name;
          if (timezone_name) params.timezone_name = timezone_name;
          if (spend_cap) params.spend_cap = spend_cap;
          const { data, rateLimit } = await client.post(`${client.accountPath}`, params);
          return { content: [{ type: "text" as const, text: JSON.stringify({ ...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 AdsClient.post() method used by the handler to send the POST request to the Meta API.
    async post(
      path: string,
      params?: Record<string, unknown>
    ): Promise<ClientResponse> {
      return this.request("POST", path, params);
    }
  • The accountPath getter that constructs the API path as /act_{accountId}, used by the handler for the POST request.
    get accountPath(): string {
      return `/act_${this.accountId}`;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden. It discloses the partial-update behavior ('Only provided fields will be modified'), which is important for a mutation tool. However, it does not mention permissions, validation, or what happens if no fields are supplied, leaving some gaps.

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 extremely concise: two sentences with no redundant information. It front-loads the purpose and immediately follows with the key behavioral caveat.

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 tool with three optional parameters and no output schema, the description covers the essential purpose and update semantics. The only notable gap is the ambiguous 'configured' account—it does not explain how the account is selected or referenced, but this may be handled at a higher level. Overall, it is sufficiently complete.

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

Parameters4/5

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

The schema already provides high coverage (100%) with clear descriptions for each parameter (name, spend_cap, timezone_name), so the baseline is 3. The description enhances understanding by clarifying that all parameters are optional and only those explicitly provided will be updated, adding semantic value 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 the tool's function with a specific verb and resource: 'Update the configured ad account settings.' It also adds a key distinguishing detail ('Only provided fields will be modified') that prevents confusion with full-replacement or other update tools.

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

Usage Guidelines3/5

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

The description implies usage context (for updating ad account settings) but does not explicitly mention alternatives or when not to use it. The word 'configured' hints at a pre-selected account, but there is no guidance on prerequisites or comparison with sibling tools like get_ad_account.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools