Skip to main content
Glama

marketo_create_channel

Create a new marketing channel in Marketo to organize and manage campaigns, forms, and assets by defining its name, type, and description.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
descriptionNo
typeYes
applicationIdNo

Implementation Reference

  • The core handler function that implements the logic for creating a Marketo channel by preparing the request data and calling the makeApiRequest helper to POST to the Marketo API endpoint.
    async ({ name, description, type, applicationId }) => { try { const data = { name, description, type, applicationId, }; const response = await makeApiRequest('/asset/v1/channels.json', 'POST', data); 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 defining required parameters (name, type) and optional ones (description, applicationId) for the marketo_create_channel tool.
    { name: z.string(), description: z.string().optional(), type: z.string(), applicationId: z.number().optional(), },
  • src/index.ts:290-320 (registration)
    The server.tool() call that registers the marketo_create_channel tool with the MCP server, providing the name, input schema, and handler function.
    server.tool( 'marketo_create_channel', { name: z.string(), description: z.string().optional(), type: z.string(), applicationId: z.number().optional(), }, async ({ name, description, type, applicationId }) => { try { const data = { name, description, type, applicationId, }; const response = await makeApiRequest('/asset/v1/channels.json', 'POST', data); 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}` }, ], }; } } );
  • Helper function makeApiRequest used by the tool to perform authenticated HTTP requests to the Marketo API.
    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