Skip to main content
Glama

update_audience

Update an existing custom audience's name or description by providing the audience ID. Only specified fields are modified.

Instructions

Update an existing custom audience. Only provided fields will be modified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audience_idYesAudience ID to update
nameNoNew audience name
descriptionNoNew audience description

Implementation Reference

  • The actual tool handler implementation for 'update_audience'. It calls `client.post(/${audience_id}, params)` to update an existing custom audience by ID. Accepts optional `name` and `description` fields.
    // ─── update_audience ───────────────────────────────────────
    server.tool(
      "update_audience",
      "Update an existing custom audience. Only provided fields will be modified.",
      {
        audience_id: z.string().describe("Audience ID to update"),
        name: z.string().optional().describe("New audience name"),
        description: z.string().optional().describe("New audience description"),
      },
      async ({ audience_id, name, description }) => {
        try {
          const params: Record<string, unknown> = {};
          if (name) params.name = name;
          if (description) params.description = description;
          const { data, rateLimit } = await client.post(`/${audience_id}`, 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 };
        }
      }
    );
  • Zod schema for 'update_audience' tool: `audience_id` (required string), `name` (optional string), `description` (optional string).
    {
      audience_id: z.string().describe("Audience ID to update"),
      name: z.string().optional().describe("New audience name"),
      description: z.string().optional().describe("New audience description"),
    },
  • The tool is registered via `server.tool("update_audience", ...)` inside the `registerAudienceTools` function in src/tools/audiences.ts.
    server.tool(
      "update_audience",
      "Update an existing custom audience. Only provided fields will be modified.",
      {
        audience_id: z.string().describe("Audience ID to update"),
        name: z.string().optional().describe("New audience name"),
        description: z.string().optional().describe("New audience description"),
      },
      async ({ audience_id, name, description }) => {
        try {
          const params: Record<string, unknown> = {};
          if (name) params.name = name;
          if (description) params.description = description;
          const { data, rateLimit } = await client.post(`/${audience_id}`, 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 `post` method on AdsClient used by the handler to send the update request to the Meta Ads API.
    async post(
      path: string,
      params?: Record<string, unknown>
    ): Promise<ClientResponse> {
      return this.request("POST", path, params);
    }
    
    async delete(
      path: string,
      params?: Record<string, unknown>
    ): Promise<ClientResponse> {
      return this.request("DELETE", path, params);
    }
Behavior3/5

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

With no annotations, the description must fully disclose behavior. It correctly indicates a mutation (update) and partial update semantics. However, it lacks details on permissions, rate limits, side effects, or response format, which are important for an agent.

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, no wasted words. Front-loaded with verb and resource. Efficiently communicates the core action and key behavioral trait.

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 given schema coverage and tool simplicity. The partial update note is valuable, but missing details on return values (no output schema) and potential constraints. Could be improved by mentioning which fields can be updated (already in schema) or prerequisites.

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?

Schema coverage is 100% with clear parameter descriptions. The description adds crucial semantic information: 'Only provided fields will be modified' clarifies the update behavior (partial vs full). This goes beyond the schema's field-level descriptions.

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?

Description clearly states it updates an existing custom audience and specifies partial update behavior ('Only provided fields will be modified'). This effectively distinguishes it from create_custom_audience and delete_audience siblings.

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?

No explicit guidance on when to use this tool vs alternatives. While the purpose is clear, the description does not mention when not to use it (e.g., for full replacement) or compare with sibling tools like create_custom_audience.

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