Skip to main content
Glama

marketo_delete_channel

Delete a specific channel in Marketo by providing its channel ID to remove it from the system.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes

Implementation Reference

  • The handler function that performs the actual deletion by sending a POST request to the Marketo API endpoint for deleting a channel.
    async ({ channelId }) => { try { const response = await makeApiRequest(`/asset/v1/channel/${channelId}/delete.json`, 'POST'); 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 schema for input validation, requiring a channelId as a number.
    { channelId: z.number(), },
  • src/index.ts:360-379 (registration)
    Registers the 'marketo_delete_channel' tool with the MCP server, including schema and handler.
    'marketo_delete_channel', { channelId: z.number(), }, async ({ channelId }) => { try { const response = await makeApiRequest(`/asset/v1/channel/${channelId}/delete.json`, 'POST'); 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 utility function used by the tool to make 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