Skip to main content
Glama
bcharleson

Instantly MCP Server

list_lead_lists

Read-only

Retrieve and organize lead lists from Instantly.ai with pagination support. Filter lists by auto-enrichment status or search by name to manage lead containers outside of campaigns.

Instructions

List lead lists with cursor-based pagination (100 per page).

PAGINATION: If response contains pagination.next_starting_after, there are MORE results. Call again with starting_after= to get next page. Continue until pagination.next_starting_after is null.

Lead lists are containers for organizing leads outside of campaigns. Use has_enrichment_task filter to find lists with auto-enrichment enabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function implementing the list_lead_lists tool. Calls the Instantly API /lead-lists endpoint with pagination and filtering parameters, adds LLM-friendly pagination hints, and returns JSON.
    async def list_lead_lists(params: Optional[ListLeadListsInput] = None) -> str:
        """
        List lead lists with cursor-based pagination (100 per page).
        
        PAGINATION: If response contains pagination.next_starting_after, there are 
        MORE results. Call again with starting_after=<that value> to get next page.
        Continue until pagination.next_starting_after is null.
        
        Lead lists are containers for organizing leads outside of campaigns.
        Use has_enrichment_task filter to find lists with auto-enrichment enabled.
        """
        client = get_client()
        
        # Handle case where params is None (for OpenAI/non-Claude clients)
        # Set default limit=100 to return more results by default
        if params is None:
            params = ListLeadListsInput(limit=100)
        
        query_params = {}
        if params.limit:
            query_params["limit"] = params.limit
        else:
            # Default to 100 results if no limit specified
            query_params["limit"] = 100
        if params.starting_after:
            query_params["starting_after"] = params.starting_after
        if params.has_enrichment_task is not None:
            query_params["has_enrichment_task"] = params.has_enrichment_task
        if params.search:
            query_params["search"] = params.search
        
        result = await client.get("/lead-lists", params=query_params)
        
        # Add pagination guidance for LLMs
        if isinstance(result, dict):
            pagination = result.get("pagination", {})
            next_cursor = pagination.get("next_starting_after")
            if next_cursor:
                result["_pagination_hint"] = f"MORE RESULTS AVAILABLE. Call list_lead_lists with starting_after='{next_cursor}' to get next page."
        
        return json.dumps(result, indent=2)
  • Pydantic BaseModel defining the input parameters for the list_lead_lists tool, including pagination, search, and filter options.
    class ListLeadListsInput(BaseModel):
        """Input for listing lead lists with pagination."""
        
        # Use extra="ignore" to be tolerant of unexpected fields from LLMs
        model_config = ConfigDict(str_strip_whitespace=True, extra="ignore")
        
        limit: Optional[int] = Field(default=100, ge=1, le=100, description="Results per page (1-100, default: 100)")
        starting_after: Optional[str] = Field(
            default=None, 
            description="Pagination cursor - use value from pagination.next_starting_after to get next page"
        )
        has_enrichment_task: Optional[bool] = Field(default=None)
        search: Optional[str] = Field(default=None, description="Search by name")
  • MCP tool registration annotation in server.py specifying that list_lead_lists is a read-only operation.
    "list_lead_lists": {"readOnlyHint": True},
  • Inclusion of the list_lead_lists handler in the LEAD_TOOLS list for export and registration.
    list_lead_lists,
  • Export of ListLeadListsInput schema model for use across the codebase.
    ListLeadListsInput,
Behavior4/5

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

Annotations declare readOnlyHint=true, which the description aligns with by describing a listing operation. The description adds valuable behavioral context beyond annotations: it explains pagination mechanics (cursor-based, 100 per page, how to continue), which is crucial for correct usage. It doesn't mention rate limits or authentication needs, but with annotations covering safety, this is sufficient.

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 well-structured and front-loaded: first sentence states core purpose, followed by dedicated PAGINATION section, then usage context. Every sentence adds value—no wasted words. It's appropriately sized for a tool with pagination complexity.

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?

Given the tool's complexity (pagination, filtering) and rich annotations (readOnlyHint), the description is complete. It explains pagination behavior, filtering use case, and resource context. With an output schema present, it doesn't need to detail return values, making this description fully adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries full burden. It effectively explains key parameters: 'starting_after' (pagination cursor), 'has_enrichment_task' (filter for auto-enrichment), and implies 'limit' (100 per page). It adds meaning beyond the bare schema by clarifying how parameters interact with pagination and filtering.

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 tool's purpose: 'List lead lists with cursor-based pagination (100 per page).' It specifies the verb ('List'), resource ('lead lists'), and scope ('with cursor-based pagination'), and distinguishes from siblings like 'get_lead_list' (singular) or 'list_leads' (different resource).

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 provides clear context for usage: 'Lead lists are containers for organizing leads outside of campaigns. Use has_enrichment_task filter to find lists with auto-enrichment enabled.' It explains when to use the filter but doesn't explicitly state when not to use this tool versus alternatives like 'list_campaigns' or 'search_campaigns_by_contact'.

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-python'

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