Skip to main content
Glama
bcharleson

Instantly MCP Server

list_lead_lists

Retrieve and manage lead lists with pagination controls to organize and access contact data for email campaigns.

Instructions

List all lead lists with pagination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of lists to return (1-100, default: 20)
starting_afterNoID of the last item from previous page for pagination

Implementation Reference

  • Main handler function that implements the list_lead_lists tool logic. Builds query parameters from input args, makes API request to /lead-lists endpoint, processes response with pagination info, and returns formatted MCP response.
    async function handleListLeadLists(args: any, apiKey: string) {
      console.error('[Instantly MCP] 📋 Executing list_lead_lists...');
    
      // Build query parameters from args
      const queryParams: any = {
        limit: args.limit || 100 // Default to 100 items per page (max pagination)
      };
    
      if (args.starting_after !== undefined) queryParams.starting_after = args.starting_after;
      if (args.has_enrichment_task !== undefined) queryParams.has_enrichment_task = args.has_enrichment_task;
      if (args.search !== undefined) queryParams.search = args.search;
    
      console.error(`[Instantly MCP] 📤 Fetching lead lists with params: ${JSON.stringify(queryParams, null, 2)}`);
    
      const listsResult = await makeInstantlyRequest('/lead-lists', { params: queryParams }, apiKey);
    
      // Extract items and pagination info
      const items = listsResult.items || listsResult;
      const nextStartingAfter = listsResult.next_starting_after;
    
      return createMCPResponse({
        success: true,
        lead_lists: items,
        next_starting_after: nextStartingAfter,
        total_returned: Array.isArray(items) ? items.length : 0,
        has_more: !!nextStartingAfter,
        message: 'Lead lists retrieved successfully'
      });
    }
  • Tool registration in leadTools array, defining name, title, description, annotations, and input schema for MCP tool registration.
    {
      name: 'list_lead_lists',
      title: 'List Lead Lists',
      description: 'List lead lists with pagination and search',
      annotations: { readOnlyHint: true },
      inputSchema: {
        type: 'object',
        properties: {
          limit: { type: 'number', description: '1-100, default: 100' },
          starting_after: { type: 'string', description: 'Cursor from pagination' },
          has_enrichment_task: { type: 'boolean' },
          search: { type: 'string', description: 'Search by name' }
        }
      }
    },
  • Zod schema definition for validating input parameters of list_lead_lists tool.
    export const ListLeadListsSchema = z.object({
      limit: z.number().int().min(1).max(100).optional(),
      starting_after: z.string().optional()
    });
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'pagination', which is a key behavioral trait not evident from the schema alone, adding value. However, it lacks details on permissions, rate limits, response format, or error conditions, leaving significant gaps for a list operation.

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 a single, efficient sentence that front-loads the core purpose ('List all lead lists') and adds essential context ('with pagination') without waste. Every word earns its place, making it easy to parse quickly.

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?

Given the tool's low complexity (list operation with 2 parameters) and no output schema, the description is minimally adequate. It covers the basic action and pagination but lacks details on return values, error handling, or integration with siblings. For a tool with no annotations, it should provide more behavioral context to be fully complete.

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 description coverage is 100%, so the schema fully documents both parameters ('limit' and 'starting_after'). The description adds no additional parameter semantics beyond implying pagination, which is already covered in the schema's descriptions. This meets the baseline for high schema coverage but doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('list') and resource ('lead lists'), making the purpose immediately understandable. It distinguishes from siblings like 'create_lead_list' (creation vs listing) and 'list_leads' (lists vs leads), though it doesn't explicitly contrast with other list operations. The description is specific but lacks explicit sibling differentiation beyond the obvious.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, timing considerations, or comparisons with other list operations (like 'list_campaigns' or 'list_leads'). The agent must infer usage from the tool name alone, which is insufficient for optimal selection.

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/bcharleson/Instantly-MCP'

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