Skip to main content
Glama

marketo_get_smart_lists

Retrieve Marketo smart list metadata including names, folders, creation/update dates, and filter rule summaries. Supports pagination with maxReturn and offset.

Instructions

List smart lists in Marketo. Returns smart list metadata including name, folder, created/updated dates, and filter rules summary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxReturnNoMax smart lists to return (1-200, default 20)
offsetNoPagination offset

Implementation Reference

  • The async handler function for marketo_get_smart_lists. It takes optional maxReturn and offset args, builds query params, calls makeRequest to GET /rest/asset/v1/smartLists.json, and returns the response via the ok helper.
    async (args) => {
      try {
        const params: Record<string, unknown> = {};
        if (args.maxReturn) params.maxReturn = args.maxReturn;
        if (args.offset) params.offset = args.offset;
        return ok(await makeRequest("/rest/asset/v1/smartLists.json", "GET", params));
      } catch (e) { return err(e); }
    }
  • Zod schema for the tool's input: optional maxReturn (number, 1-200, default 20) and offset (number) for pagination.
    {
      maxReturn: z.number().optional().describe("Max smart lists to return (1-200, default 20)"),
      offset: z.number().optional().describe("Pagination offset"),
    },
  • Registration of the tool via server.tool() with the name 'marketo_get_smart_lists' and a description. Called from registerSmartListTools which is invoked in src/index.ts line 25.
    server.tool(
      "marketo_get_smart_lists",
      "List smart lists in Marketo. Returns smart list metadata including name, folder, created/updated dates, and filter rules summary.",
      {
        maxReturn: z.number().optional().describe("Max smart lists to return (1-200, default 20)"),
        offset: z.number().optional().describe("Pagination offset"),
      },
      async (args) => {
        try {
          const params: Record<string, unknown> = {};
          if (args.maxReturn) params.maxReturn = args.maxReturn;
          if (args.offset) params.offset = args.offset;
          return ok(await makeRequest("/rest/asset/v1/smartLists.json", "GET", params));
        } catch (e) { return err(e); }
      }
    );
  • src/index.ts:20-29 (registration)
    Top-level registration: registerSmartListTools(server) wires the smart list tools (including marketo_get_smart_lists) into the MCP server.
    // Register all tool groups
    registerFormTools(server);
    registerLeadTools(server);
    registerProgramTools(server);
    registerEmailTools(server);
    registerSmartListTools(server);
    registerListTools(server);
    registerChannelTools(server);
    registerLandingPageTools(server);
    registerBulkExportTools(server);
  • The makeRequest helper that executes authenticated HTTP requests to the Marketo API. Used by the smart list handler to call the Marketo REST endpoint.
    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?

No annotations provided; description correctly implies a read operation but does not disclose pagination behavior or default values, which are only in 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 concise sentences: one for action, one for return content. No redundant information.

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?

No output schema, but description lists return fields adequately. However, lacks mention of pagination behavior or typical use cases for the offset parameter.

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%, so description adds little to parameter understanding beyond restating the schema's purpose.

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?

Clear verb 'List' and resource 'smart lists', with explicit return fields (name, folder, dates, filter rules). Distinguishes from sibling tools like marketo_get_smart_list_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 Guidelines2/5

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

No explicit guidance on when to use this tool vs alternatives. While siblings include a get-by-id variant, the description does not mention selection criteria or limitations.

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