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 {

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.2.1

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It mentions the core behavior (creates a duplicate) but does not disclose nuances like whether all fields are copied, the independence of the copy from the source, or permission requirements. It's adequate but not rich.

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 concise sentences front-load the primary purpose and the key variation (same/different ad set). Every word earns its place, with no redundancy or unrelated information.

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?

For a simple copy tool with fully documented parameters, the description covers the main action and scope. However, it lacks any mention of return values (e.g., new ad ID) or side effects, and with no output schema, this leaves a gap for the agent.

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%, and the description does not add semantic meaning beyond the schema. The adset_id parameter's behavior (same/different ad set) is already documented in the schema, so the tool description adds no extra value here.

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 the action ('Copy an existing ad') with a specific resource, and adds scope ('within the same or different ad set') that differentiates it from create/update/delete ad tools. It's a specific verb+resource pairing.

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 usage is implied by the description — copying an ad when you want a duplicate. However, there is no explicit guidance on when to prefer this over create_ad or update_ad, nor any alternatives mentioned.

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