Skip to main content
Glama

marketo_delete_lead

Permanently delete a Marketo lead by providing its lead ID. This irreversible tool removes the specified lead from your Marketo database.

Instructions

Delete a lead from Marketo by lead ID. This is permanent and cannot be undone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesLead ID to delete

Implementation Reference

  • The handler for 'marketo_delete_lead'. Registers a tool that accepts a numeric 'id' and makes a POST request to `DELETE /rest/v1/leads/{id}/delete.json` to permanently delete a Marketo lead.
    server.tool(
      "marketo_delete_lead",
      "Delete a lead from Marketo by lead ID. This is permanent and cannot be undone.",
      {
        id: z.number().describe("Lead ID to delete"),
      },
      async (args) => {
        try {
          return ok(await makeRequest(`/rest/v1/leads/${args.id}/delete.json`, "POST"));
        } catch (e) { return err(e); }
      }
    );
  • The input schema for 'marketo_delete_lead'. Defines a single required parameter 'id' of type number (Zod schema) representing the Marketo lead ID to delete.
    {
      id: z.number().describe("Lead ID to delete"),
  • src/index.ts:22-22 (registration)
    The registration call: `registerLeadTools(server)` is invoked in the main entry point, which causes the tool 'marketo_delete_lead' to be registered on the MCP server.
    registerLeadTools(server);
  • The `makeRequest` helper function used by the tool handler to make authenticated HTTP requests to the Marketo REST API. It handles OAuth token injection and error parsing.
    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;
    }
Behavior4/5

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

No annotations are provided, so the description bears full burden. It discloses the key behavioral trait: deletion is permanent and cannot be undone. This adds critical context beyond the schema.

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, zero waste. The action and warning are front-loaded, making the description efficient and easy to parse.

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

Completeness5/5

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

For a simple delete operation with one required parameter, the description is complete: it specifies the action, how to identify the lead, and the permanent nature. No output schema is needed for a side-effect operation.

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% for the 'id' parameter, and its description 'Lead ID to delete' is clear. The tool description adds no extra parameter information beyond confirming the parameter's role.

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 'Delete a lead from Marketo by lead ID'—a specific verb+resource+identifier. It distinguishes from siblings like marketo_get_lead_by_id or marketo_remove_leads_from_list, which perform different actions.

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

Usage Guidelines4/5

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

The description warns that deletion is permanent and irreversible, implying careful use. While it doesn't explicitly compare to siblings, the context makes it clear this is for permanent removal, not list modification.

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