Skip to main content
Glama

marketo_remove_leads_from_list

Remove specific leads from a Marketo static list. Provide list ID and array of up to 300 lead IDs to clean your lists.

Instructions

Remove one or more leads from a static list by lead IDs. Max 300 leads per call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
listIdYesStatic list ID
leadIdsYesArray of lead IDs to remove (max 300)

Implementation Reference

  • The handler function for marketo_remove_leads_from_list. Maps leadIds to input array and POSTs to Marketo's /rest/v1/lists/{listId}/leads/delete.json.
    async (args) => {
      try {
        const input = args.leadIds.map(id => ({ id }));
        return ok(await makeRequest(
          `/rest/v1/lists/${args.listId}/leads/delete.json`,
          "POST",
          { input },
          "application/json"
        ));
      } catch (e) { return err(e); }
    }
  • Input schema using Zod: listId (number) and leadIds (array of numbers, max 300).
    {
      listId: z.number().describe("Static list ID"),
      leadIds: z.array(z.number()).describe("Array of lead IDs to remove (max 300)"),
    },
  • Tool registration via server.tool() with name 'marketo_remove_leads_from_list' and description.
    server.tool(
      "marketo_remove_leads_from_list",
      "Remove one or more leads from a static list by lead IDs. Max 300 leads per call.",
      {
        listId: z.number().describe("Static list ID"),
        leadIds: z.array(z.number()).describe("Array of lead IDs to remove (max 300)"),
      },
      async (args) => {
        try {
          const input = args.leadIds.map(id => ({ id }));
          return ok(await makeRequest(
            `/rest/v1/lists/${args.listId}/leads/delete.json`,
            "POST",
            { input },
            "application/json"
          ));
        } catch (e) { return err(e); }
      }
    );
  • src/index.ts:21-26 (registration)
    The registerListTools function is called here, which registers all list tools including marketo_remove_leads_from_list.
    registerFormTools(server);
    registerLeadTools(server);
    registerProgramTools(server);
    registerEmailTools(server);
    registerSmartListTools(server);
    registerListTools(server);
  • The makeRequest helper used by the handler to send authenticated HTTP requests to the Marketo API.
    export async function makeRequest<T = unknown>(
      endpoint: string,
      method: Method = "GET",
      data?: unknown,
      contentType?: string,
    ): Promise<T> {
      const token = await getAccessToken();
      const config: AxiosRequestConfig = {
        url: `${MARKETO_BASE_URL}${endpoint}`,
        method,
        headers: {
          Authorization: `Bearer ${token}`,
          ...(contentType ? { "Content-Type": contentType } : {}),
        },
        ...(data && method !== "GET" ? { data } : {}),
        ...(data && method === "GET" ? { params: data } : {}),
      };
    
      const res = await axios(config);
      const body = res.data;
    
      // Marketo REST API returns errors inside the response body
      if (body?.errors?.length) {
        const e = body.errors[0];
        throw new MarketoError(`${e.code}: ${e.message}`, res.status);
      }
    
      return body as T;
    }
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It states the operation is a removal and mentions a 300-lead limit, but lacks details on reversibility, authorization, error handling, or response format.

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 two sentences, front-loaded with key information, and contains no redundant or extraneous words.

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 is adequate for a simple removal operation but lacks information on error handling, idempotency, and return values. Given no output schema, more context would be beneficial.

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?

Schema coverage is 100% and schema descriptions already include the max 300 leads constraint. The description adds no new meaning beyond what the schema provides, so baseline score applies.

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 (remove), resource (leads from a static list), and method (by lead IDs). It distinguishes from the sibling tool 'marketo_add_leads_to_list' which performs the opposite operation.

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?

The description implies usage for removing leads but does not explicitly state when to use or when not to use it. No mention of alternatives or prerequisites, though the sibling tool provides contrast.

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/ZLeventer/marketo-mcp-server'

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