Skip to main content
Glama

copy_ad

Duplicate an existing ad within the same or a different ad set. Assign a new name and status to the copy.

Instructions

Copy an existing ad. Creates a duplicate within the same or different ad set.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_idYesSource ad ID to copy
adset_idNoTarget ad set ID. If omitted, copies to same ad set
nameNoName for the copied ad
statusNoStatus for copied ad (default PAUSED)PAUSED

Implementation Reference

  • The handler function for copy_ad that copies an existing ad via POST /{ad_id}/copies. Supports optional adset_id, name (renaming), and status parameters.
      async ({ ad_id, adset_id, name, status }) => {
        try {
          const params: Record<string, unknown> = {};
          if (adset_id) params.adset_id = adset_id;
          if (name) params.rename_options = JSON.stringify({ rename_suffix: "", rename_prefix: "", new_name_prefix: name });
          if (status) params.status_option = status;
          const { data, rateLimit } = await client.post(`/${ad_id}/copies`, 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 defining input parameters for copy_ad: ad_id (required), adset_id (optional), name (optional), status (optional, defaults to PAUSED).
    {
      ad_id: z.string().describe("Source ad ID to copy"),
      adset_id: z.string().optional().describe("Target ad set ID. If omitted, copies to same ad set"),
      name: z.string().optional().describe("Name for the copied ad"),
      status: z.string().optional().default("PAUSED").describe("Status for copied ad (default PAUSED)"),
    },
  • Tool registration via server.tool() within the registerAdTools function. The tool is named 'copy_ad' with a description about duplicating ads.
    server.tool(
      "copy_ad",
      "Copy an existing ad. Creates a duplicate within the same or different ad set.",
      {
        ad_id: z.string().describe("Source ad ID to copy"),
        adset_id: z.string().optional().describe("Target ad set ID. If omitted, copies to same ad set"),
        name: z.string().optional().describe("Name for the copied ad"),
        status: z.string().optional().default("PAUSED").describe("Status for copied ad (default PAUSED)"),
      },
      async ({ ad_id, adset_id, name, status }) => {
        try {
          const params: Record<string, unknown> = {};
          if (adset_id) params.adset_id = adset_id;
          if (name) params.rename_options = JSON.stringify({ rename_suffix: "", rename_prefix: "", new_name_prefix: name });
          if (status) params.status_option = status;
          const { data, rateLimit } = await client.post(`/${ad_id}/copies`, 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 };
        }
      }
    );
  • src/index.ts:52-52 (registration)
    Top-level registration call in index.ts that activates the copy_ad (and all other ad) tools.
    registerAdTools(server, client);
  • The exported registerAdTools function that encapsulates all ad tool registrations including copy_ad.
    export function registerAdTools(server: McpServer, client: AdsClient): void {
Behavior3/5

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

With no annotations, the description must carry the burden. It mentions duplication across ad sets but omits behavioral details like default status (PAUSED, only in schema), consistency constraints, and whether creative is duplicated.

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 front-loaded sentence with zero waste, efficiently conveying the core action and scope.

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?

While adequate for a simple copy operation, the lack of output schema and missing details about what is copied (e.g., creative, targeting) leaves gaps. Could be more complete.

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?

Input schema has 100% coverage, so description adds no extra meaning beyond the schema. Baseline 3 is appropriate.

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 'Copy an existing ad' with a specific verb and resource. It adds scope by mentioning 'within the same or different ad set,' which differentiates it from siblings like copy_adset and create_ad.

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 for duplicating ads but does not explicitly state when to use this tool over alternatives (e.g., create_ad with copied fields) or mention any prerequisites.

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