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}`;
    }
Behavior2/5

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

With no annotations, the description must disclose behavior. It indicates mutation and partial updates but omits side effects, authorization, or error handling. For a write operation, 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with the verb first, concise and without fluff. Could be slightly expanded for context without losing conciseness.

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

Completeness3/5

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

Adequate for a simple update tool with three optional parameters. Lacks details on return format or behavior when no fields are provided. Acceptable but not thorough.

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 100%, so the description adds no value beyond the schema. Baseline score of 3 is appropriate.

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?

The description clearly states the tool updates ad account settings and mentions partial updates. It distinguishes from other update tools by specifying 'ad account' as the resource.

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?

No guidance is provided on when to use this tool over alternatives like update_campaign or update_ad. It does not mention prerequisites or conditions.

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

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