Skip to main content
Glama
alexleventer

Marketo MCP Server

by alexleventer

marketo_clone_program

Clone a Marketo program including all local assets (emails, landing pages, smart campaigns) into a destination folder, preserving the same channel.

Instructions

Clone an existing program into a destination folder. Clones all local assets (emails, landing pages, smart campaigns) within the program. The cloned program is created with the same channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
programIdYes
nameYes
folderIdYes
descriptionNo

Implementation Reference

  • Registration and handler for 'marketo_clone_program' tool. Clones an existing Marketo program via POST to /asset/v1/program/{programId}/clone.json with name, folder (as JSON string with 'Folder' type), and optional description. Uses 'application/x-www-form-urlencoded' content type.
    server.tool(
      'marketo_clone_program',
      'Clone an existing program into a destination folder. Clones all local assets (emails, landing pages, smart campaigns) within the program. The cloned program is created with the same channel.',
      {
        programId: z.number(),
        name: z.string(),
        folderId: z.number(),
        description: z.string().optional(),
      },
      tool(async ({ programId, name, folderId, description }) =>
        makeApiRequest(
          `/asset/v1/program/${programId}/clone.json`,
          'POST',
          {
            name,
            folder: JSON.stringify({ id: folderId, type: 'Folder' }),
            description,
          },
          'application/x-www-form-urlencoded'
        )
      )
    );
  • Input schema for marketo_clone_program: programId (number), name (string), folderId (number), description (optional string).
    {
      programId: z.number(),
      name: z.string(),
      folderId: z.number(),
      description: z.string().optional(),
    },
  • The makeApiRequest helper function used to execute the API call. Handles token injection, content-type headers, URL-encoded form data for POST requests, and error handling.
    async function makeApiRequest(
      endpoint: string,
      method: string,
      data?: any,
      contentType: string = 'application/json'
    ) {
      const token = await tokenManager.getToken();
      const headers: Record<string, string> = {
        Authorization: `Bearer ${token}`,
      };
    
      if (contentType) {
        headers['Content-Type'] = contentType;
      }
    
      try {
        const response = await axios({
          url: `${MARKETO_BASE_URL}${endpoint}`,
          method,
          data:
            contentType === 'application/x-www-form-urlencoded'
              ? new URLSearchParams(data).toString()
              : data,
          headers,
        });
        return response.data;
      } catch (error: any) {
        console.error('API request failed:', error.response?.data || error.message);
        throw error;
      }
    }
  • The 'tool' wrapper function that wraps handlers with error handling and response formatting. Catches errors and returns them as isError responses.
    function tool<T>(handler: (args: T) => Promise<unknown>) {
      return async (args: T) => {
        try {
          const response = await handler(args);
          return {
            content: [{ type: 'text' as const, text: JSON.stringify(response, null, 2) }],
          };
        } catch (error: any) {
          return {
            content: [
              {
                type: 'text' as const,
                text: `Error: ${error.response?.data?.message || error.message}`,
              },
            ],
            isError: true,
          };
        }
      };
Behavior3/5

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

With no annotations, the description carries the burden of disclosing behavioral traits. It explains that all local assets are cloned and the channel is preserved, but it does not address potential side effects (e.g., whether program memberships are cloned), required permissions, or rate limits. The description lacks depth beyond the core functionality.

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 three sentences long, each sentence adding distinct value: purpose, scope of cloning, and channel preservation. It is front-loaded with the essential verb and resource, and no extraneous information is present.

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?

The description covers the input scope well but omits important details such as the return value (e.g., the new program's ID) and error conditions (e.g., what happens if the source program does not exist). Given that there is no output schema, the description should provide minimal expectations for the response.

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?

The input schema has 0% description coverage, placing the burden on the description. While the description implies the roles of programId (source program) and folderId (destination folder), it does not explicitly define name or description parameters. The meaning of these parameters is left to inference, which is insufficient for a schema with no additional documentation.

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 the action ('Clone'), the resource ('existing program'), the destination ('destination folder'), and specifies what content is cloned ('local assets such as emails, landing pages, smart campaigns'). It also mentions the cloned program retains the same channel. This effectively distinguishes it from sibling tools like marketo_clone_form or marketo_create_channel.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for duplicating an existing program, which contrasts with creating a new program from scratch (no create program tool exists among siblings). However, it does not explicitly state when to use this tool versus cloning a specific form (marketo_clone_form) or other alternatives, nor does it mention 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/alexleventer/marketo-mcp'

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