Skip to main content
Glama

marketo_clone_form

Clone Marketo forms to create duplicates with new names and descriptions while maintaining original structure and settings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formIdYes
nameYes
descriptionNo
folderIdYes

Implementation Reference

  • The async handler function that implements the core logic for cloning a Marketo form by making a POST request to the API endpoint `/asset/v1/form/{formId}/clone.json` with the provided name, description, and folder.
    async ({ formId, name, description, folderId }) => { try { const formData = { name, description, folder: JSON.stringify({ id: folderId, type: 'Folder' }), }; const response = await makeApiRequest( `/asset/v1/form/${formId}/clone.json`, 'POST', formData, 'application/x-www-form-urlencoded' ); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error: ${error.response?.data?.message || error.message}` }, ], }; } }
  • Zod input schema validating the parameters: formId (number), name (string), description (optional string), folderId (number).
    formId: z.number(), name: z.string(), description: z.string().optional(), folderId: z.number(), },
  • src/index.ts:120-154 (registration)
    Registration of the 'marketo_clone_form' tool on the MCP server using server.tool(), including inline schema and handler.
    server.tool( 'marketo_clone_form', { formId: z.number(), name: z.string(), description: z.string().optional(), folderId: z.number(), }, async ({ formId, name, description, folderId }) => { try { const formData = { name, description, folder: JSON.stringify({ id: folderId, type: 'Folder' }), }; const response = await makeApiRequest( `/asset/v1/form/${formId}/clone.json`, 'POST', formData, 'application/x-www-form-urlencoded' ); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error: ${error.response?.data?.message || error.message}` }, ], }; } } );
  • Shared helper function for making authenticated HTTP requests to the Marketo API, used by the marketo_clone_form handler to perform the clone operation.
    async function makeApiRequest( endpoint: string, method: string, data?: any, contentType: string = 'application/json' ) { const token = await tokenManager.getToken(); const headers: any = { Authorization: `Bearer ${token}`, }; if (contentType) { headers['Content-Type'] = contentType; } try { const response = await axios({ url: `${MARKETO_BASE_URL}${endpoint}`, method: 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; } }

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