Skip to main content
Glama

marketo_get_bulk_export_file

Retrieve the CSV or TSV file from a completed bulk export job in Marketo. Specify the export job ID to download its data. Only works when the job status is Completed.

Instructions

Download the file from a completed bulk export job. Returns CSV/TSV content. Only works when job status is Completed. Large files may be clipped in MCP response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exportIdYesExport job ID (must be in Completed status)

Implementation Reference

  • The handler function for the 'marketo_get_bulk_export_file' tool. Defines the schema (exportId required), and calls makeRequest to GET /bulk/v1/leads/export/{exportId}/file.json, returning the CSV/TSV file content.
    server.tool(
      "marketo_get_bulk_export_file",
      "Download the file from a completed bulk export job. Returns CSV/TSV content. Only works when job status is Completed. Large files may be clipped in MCP response.",
      {
        exportId: z.string().describe("Export job ID (must be in Completed status)"),
      },
      async (args) => {
        try {
          return ok(await makeRequest(`/bulk/v1/leads/export/${args.exportId}/file.json`));
        } catch (e) { return err(e); }
      }
    );
  • Input schema for the tool: requires an 'exportId' string describing the export job ID (must be in Completed status).
    {
      exportId: z.string().describe("Export job ID (must be in Completed status)"),
    },
  • Tool registered via server.tool() call within registerBulkExportTools function, using the name 'marketo_get_bulk_export_file'.
    server.tool(
      "marketo_get_bulk_export_file",
      "Download the file from a completed bulk export job. Returns CSV/TSV content. Only works when job status is Completed. Large files may be clipped in MCP response.",
      {
        exportId: z.string().describe("Export job ID (must be in Completed status)"),
      },
      async (args) => {
        try {
          return ok(await makeRequest(`/bulk/v1/leads/export/${args.exportId}/file.json`));
        } catch (e) { return err(e); }
      }
    );
  • src/index.ts:29-29 (registration)
    Registration entry point: registerBulkExportTools(server) is called from index.ts to register all bulk export tools including marketo_get_bulk_export_file.
    registerBulkExportTools(server);
  • The makeRequest helper used by the handler. Handles authentication (via getAccessToken), constructs the API call, and processes Marketo error responses.
    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;
    }
Behavior3/5

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

With no annotations, the description must disclose behavior. It warns that 'Large files may be clipped in MCP response', which is useful. However, it omits details on error conditions (e.g., non-Completed status) and response handling (e.g., whether the content is inline or a URL). Basic transparency, but gaps remain.

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?

Three short sentences, each contributing essential information. The purpose is stated first, followed by format, then warning. No redundancy or filler.

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 one-parameter tool with no output schema, the description covers the main behavior: download completes, returns CSV/TSV, and clipping possibility. It lacks details on exact response format (e.g., inline binary or base64) and error messages, but is largely complete for typical use.

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?

The single parameter exportId has a description in the input schema that is repeated in the tool description ('must be in Completed status'). Since schema description coverage is 100%, the baseline is 3. The description adds no additional meaning beyond what the schema already provides.

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 verb 'Download', the resource 'file from a completed bulk export job', and the output format 'CSV/TSV content'. It is specific and distinguishes from sibling tools like marketo_create_bulk_export_leads or marketo_get_bulk_export_status.

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 specifies a clear precondition: 'Only works when job status is Completed.' This guides the agent to check status before invoking. It does not explicitly name alternatives, but the context implies it is the final step in the bulk export workflow.

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