Skip to main content
Glama
alexleventer

Marketo MCP Server

by alexleventer

marketo_delete_channel

Remove a channel from Marketo by providing its ID. The deletion only succeeds if no programs are currently associated with the channel.

Instructions

Delete a channel by ID. Fails if any programs are currently using this channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes

Implementation Reference

  • The handler function that executes the marketo_delete_channel tool logic. Makes a POST request to /asset/v1/channel/{channelId}/delete.json to delete a channel by its numeric ID.
    tool(async ({ channelId }) =>
      makeApiRequest(`/asset/v1/channel/${channelId}/delete.json`, 'POST')
    )
  • The input schema for marketo_delete_channel, defined using Zod. Accepts a single required parameter: channelId (number).
    { channelId: z.number() },
  • src/index.ts:240-247 (registration)
    Registration of the tool on the McpServer via server.tool() with name 'marketo_delete_channel', description, Zod schema, and handler wrapped in the tool() error-handling helper.
    server.tool(
      'marketo_delete_channel',
      'Delete a channel by ID. Fails if any programs are currently using this channel.',
      { channelId: z.number() },
      tool(async ({ channelId }) =>
        makeApiRequest(`/asset/v1/channel/${channelId}/delete.json`, 'POST')
      )
    );
  • The makeApiRequest helper function used by the handler to make authenticated HTTP requests to Marketo REST API endpoints. Handles token injection, content-type formatting, and error logging.
    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 helper that provides standardized error handling and response formatting for all tool handlers, including marketo_delete_channel.
    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?

Discloses that deletion fails if programs use the channel. No other behavioral traits like irreversibility, permissions, or side effects. With no annotations, more details would be beneficial.

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?

Two sentences, no unnecessary words. Front-loaded with verb and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple delete tool with one parameter, the description covers the key failure condition. Missing details on return value or confirmation, but adequate given tool simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no information about the channelId parameter beyond what the schema provides ('by ID'). With 0% schema description coverage, the description should compensate but does not.

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?

Explicit verb 'Delete' with resource 'channel by ID'. Includes crucial constraint about program usage, distinguishing it from marketo_create_channel, marketo_update_channel, and marketo_get_channel_by_id.

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

Usage Guidelines3/5

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

Mentions failure condition (programs using channel) but does not explicitly state when to use versus alternatives or recommend checking channel usage first.

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