Skip to main content
Glama

marketo_clone_email

Clone an existing Marketo email to create a draft copy in a target folder, with a new name and optional description. Ideal for reusing email templates or creating variations.

Instructions

Clone an existing Marketo email asset. Creates a draft copy with the specified name in the target folder.

Input Schema

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

Implementation Reference

  • The marketo_clone_email tool handler function defined via server.tool(). It takes id, name, folderId, folderType, and optional description, then POSTs to /rest/asset/v1/email/{id}/clone.json with x-www-form-urlencoded body containing name, folder (JSON), and optional description.
    // ── marketo_clone_email ────────────────────────────────────────────────────
    server.tool(
      "marketo_clone_email",
      "Clone an existing Marketo email asset. Creates a draft copy with the specified name in the target folder.",
      {
        id: z.number().describe("ID of the email to clone"),
        name: z.string().describe("Name for the cloned email"),
        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 email"),
      },
      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/email/${args.id}/clone.json`,
            "POST",
            body,
            "application/x-www-form-urlencoded"
          ));
        } catch (e) { return err(e); }
      }
    );
  • The registerEmailTools function is exported and called from src/index.ts, which is where all tools including marketo_clone_email are registered on the MCP server.
    export function registerEmailTools(server: McpServer) {
      // ── marketo_get_emails ─────────────────────────────────────────────────────
      server.tool(
        "marketo_get_emails",
        "List email assets in Marketo. Supports pagination via maxReturn/offset and filtering by status (approved/draft). Returns email metadata including subject line, from address, and folder.",
        {
          maxReturn: z.number().optional().describe("Max emails to return (1-200, default 20)"),
          offset: z.number().optional().describe("Pagination offset"),
          status: z.enum(["approved", "draft"]).optional().describe("Filter by approval status"),
        },
        async (args) => {
          try {
            const params: Record<string, unknown> = {};
            if (args.maxReturn) params.maxReturn = args.maxReturn;
            if (args.offset) params.offset = args.offset;
            if (args.status) params.status = args.status;
            return ok(await makeRequest("/rest/asset/v1/emails.json", "GET", params));
          } catch (e) { return err(e); }
        }
      );
    
      // ── marketo_get_email_by_id ────────────────────────────────────────────────
      server.tool(
        "marketo_get_email_by_id",
        "Get a single Marketo email asset by ID. Returns full email metadata including HTML content, subject line, from/reply-to, and module structure.",
        {
          id: z.number().describe("Email asset ID"),
        },
        async (args) => {
          try {
            return ok(await makeRequest(`/rest/asset/v1/email/${args.id}.json`));
          } catch (e) { return err(e); }
        }
      );
    
      // ── marketo_clone_email ────────────────────────────────────────────────────
      server.tool(
        "marketo_clone_email",
        "Clone an existing Marketo email asset. Creates a draft copy with the specified name in the target folder.",
        {
          id: z.number().describe("ID of the email to clone"),
          name: z.string().describe("Name for the cloned email"),
          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 email"),
        },
        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/email/${args.id}/clone.json`,
              "POST",
              body,
              "application/x-www-form-urlencoded"
            ));
          } catch (e) { return err(e); }
        }
      );
    
      // ── marketo_send_sample ────────────────────────────────────────────────────
      server.tool(
        "marketo_send_sample",
        "Send a sample/test email to an email address. Optionally render personalization tokens using a specific lead's data. Useful for QA before approving.",
        {
          id: z.number().describe("Email asset ID"),
          emailAddress: z.string().describe("Recipient email address for the sample"),
          textOnly: z.boolean().optional().describe("Send text-only version"),
          leadId: z.number().optional().describe("Lead ID whose data to use for token rendering"),
        },
        async (args) => {
          try {
            const body: Record<string, unknown> = {
              emailAddress: args.emailAddress,
            };
            if (args.textOnly !== undefined) body.textOnly = args.textOnly;
            if (args.leadId) body.leadId = args.leadId;
            return ok(await makeRequest(
              `/rest/asset/v1/email/${args.id}/sendSample.json`,
              "POST",
              body,
              "application/x-www-form-urlencoded"
            ));
          } catch (e) { return err(e); }
        }
      );
    }
  • src/index.ts:20-29 (registration)
    The registration call-site where registerEmailTools(server) is invoked, which registers marketo_clone_email on the MCP server.
    // Register all tool groups
    registerFormTools(server);
    registerLeadTools(server);
    registerProgramTools(server);
    registerEmailTools(server);
    registerSmartListTools(server);
    registerListTools(server);
    registerChannelTools(server);
    registerLandingPageTools(server);
    registerBulkExportTools(server);
  • Zod schema definitions for the marketo_clone_email tool inputs: id (number), name (string), folderId (number), folderType (enum Folder/Program with default Folder), and optional description (string).
    {
      id: z.number().describe("ID of the email to clone"),
      name: z.string().describe("Name for the cloned email"),
      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 email"),
    },
  • The makeRequest helper function used by the marketo_clone_email handler to make authenticated HTTP requests to the Marketo API. Also provides ok/err wrappers used for return values.
    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;
    }
Behavior3/5

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

With no annotations, the description carries the burden; it states the tool creates a draft copy (mutation), but does not disclose permissions, rate limits, or independence of the clone, leaving behavioral gaps.

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?

Single sentence is efficient and front-loaded, covering purpose and result with no wasted words, though a bit more detail could be included without harming 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?

Given no output schema and moderate complexity (5 params), the description covers the essential action but could mention that the original remains unchanged or that the clone ID is returned.

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 coverage is 100%, baseline 3; description adds minimal value beyond 'specified name in the target folder' without elaborating on folderType or description parameters.

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?

Clearly states it clones a Marketo email asset, specifies it creates a draft copy with a given name in a target folder, distinguishing it from sibling clone tools for other asset types.

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 explicit guidance on when to use this tool versus alternatives; usage is only implied by the tool name and description, lacking scenarios 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