Skip to main content
Glama

marketo_clone_program

Clone any Marketo program to a new folder, copying all local assets (emails, landing pages, smart campaigns). Specify the source program ID, new name, destination folder, and optional description.

Instructions

Clone an existing Marketo program. Creates a copy with all local assets (emails, LPs, smart campaigns) under the specified name and folder.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the program to clone
nameYesName for the cloned program
folderIdYesDestination folder ID
folderTypeNoType of destination folderFolder
descriptionNoDescription for the cloned program

Implementation Reference

  • The async handler function that executes the clone logic: builds a POST body with name, folder (JSON stringified), and optional description, then calls the Marketo Asset API endpoint /rest/asset/v1/program/{id}/clone.json via makeRequest.
      async (args) => {
        try {
          const body: Record<string, unknown> = {
            name: args.name,
            folder: JSON.stringify({ id: args.folderId, type: args.folderType }),
          };
          if (args.description) body.description = args.description;
          return ok(await makeRequest(
            `/rest/asset/v1/program/${args.id}/clone.json`,
            "POST",
            body,
            "application/x-www-form-urlencoded"
          ));
        } catch (e) { return err(e); }
      }
    );
  • Input schema using Zod: id (number, required), name (string, required), folderId (number, required), folderType (enum 'Folder'|'Program', default 'Folder'), description (optional string).
    {
      id: z.number().describe("ID of the program to clone"),
      name: z.string().describe("Name for the cloned program"),
      folderId: z.number().describe("Destination folder ID"),
      folderType: z.enum(["Folder", "Program"]).default("Folder").describe("Type of destination folder"),
      description: z.string().optional().describe("Description for the cloned program"),
    },
  • Registration via server.tool('marketo_clone_program', ...) inside the registerProgramTools function, which is called from src/index.ts.
    server.tool(
      "marketo_clone_program",
      "Clone an existing Marketo program. Creates a copy with all local assets (emails, LPs, smart campaigns) under the specified name and folder.",
      {
        id: z.number().describe("ID of the program to clone"),
        name: z.string().describe("Name for the cloned program"),
        folderId: z.number().describe("Destination folder ID"),
        folderType: z.enum(["Folder", "Program"]).default("Folder").describe("Type of destination folder"),
        description: z.string().optional().describe("Description for the cloned program"),
      },
      async (args) => {
        try {
          const body: Record<string, unknown> = {
            name: args.name,
            folder: JSON.stringify({ id: args.folderId, type: args.folderType }),
          };
          if (args.description) body.description = args.description;
          return ok(await makeRequest(
            `/rest/asset/v1/program/${args.id}/clone.json`,
            "POST",
            body,
            "application/x-www-form-urlencoded"
          ));
        } catch (e) { return err(e); }
      }
    );
  • The makeRequest helper handles the actual HTTP call to the Marketo API with authentication, error handling, and content-type support (used with 'application/x-www-form-urlencoded' for clone).
    export async function makeRequest<T = unknown>(
      endpoint: string,
      method: Method = "GET",
      data?: unknown,
      contentType?: string,
    ): Promise<T> {
      const token = await getAccessToken();
      const config: AxiosRequestConfig = {
        url: `${MARKETO_BASE_URL}${endpoint}`,
        method,
        headers: {
          Authorization: `Bearer ${token}`,
          ...(contentType ? { "Content-Type": contentType } : {}),
        },
        ...(data && method !== "GET" ? { data } : {}),
        ...(data && method === "GET" ? { params: data } : {}),
      };
    
      const res = await axios(config);
      const body = res.data;
    
      // Marketo REST API returns errors inside the response body
      if (body?.errors?.length) {
        const e = body.errors[0];
        throw new MarketoError(`${e.code}: ${e.message}`, res.status);
      }
    
      return body as T;
    }
  • The ok/err response helpers used by the handler to format the MCP tool response.
    export function ok(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It mentions that a copy is created with all local assets and under specified name/folder, but omits side effects, permissions, runtime behavior, or return value.

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, efficient sentence that conveys the main purpose. It could benefit from slight structuring (e.g., listing assets), but it avoids verbosity.

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

Completeness2/5

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

Given the absence of annotations and output schema, the description does not cover return values, validation behavior, or post-clone workflow, leaving gaps for effective agent invocation.

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 baseline is 3. The description adds minimal extra value beyond the schema, only reiterating that cloning involves name and folder destination.

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 'Clone an existing Marketo program' with explicit details about what is copied (all local assets: emails, LPs, smart campaigns), distinguishing it from sibling tools that clone individual assets.

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 this tool is for full program cloning but does not explicitly state when to use it versus creating a new program or cloning sub-assets. No mention of alternatives or exclusions.

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/ZLeventer/marketo-mcp-server'

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