Skip to main content
Glama
bcharleson

Instantly MCP Server

list_accounts

Read-only

Retrieve email accounts with pagination, filtering by status, provider, or search criteria to manage outreach campaigns.

Instructions

List email accounts 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.

Status codes: 1=Active, 2=Paused, -1/-2/-3=Errors Provider codes: 1=IMAP, 2=Google, 3=Microsoft, 4=AWS

Returns accounts with warmup status and campaign eligibility.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main execution handler for the list_accounts tool. Fetches accounts via API with support for pagination, search, filters, and adds LLM-friendly pagination hints.
    async def list_accounts(params: Optional[ListAccountsInput] = None) -> str:
        """
        List email accounts 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.
        
        Status codes: 1=Active, 2=Paused, -1/-2/-3=Errors
        Provider codes: 1=IMAP, 2=Google, 3=Microsoft, 4=AWS
        
        Returns accounts with warmup status and campaign eligibility.
        """
        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 = ListAccountsInput(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.search:
            query_params["search"] = params.search
        if params.status is not None:
            query_params["status"] = params.status
        if params.provider_code is not None:
            query_params["provider_code"] = params.provider_code
        if params.tag_ids:
            query_params["tag_ids"] = params.tag_ids
        
        result = await client.get("/accounts", 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_accounts with starting_after='{next_cursor}' to get next page."
        
        return json.dumps(result, indent=2)
  • Pydantic model defining the input schema for list_accounts parameters including pagination, search, status, and provider filters.
    class ListAccountsInput(BaseModel):
        """Input for listing email accounts."""
        
        # 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"
        )
        search: Optional[str] = Field(
            default=None,
            description="Search by email domain"
        )
        status: Optional[Literal[1, 2, -1, -2, -3]] = Field(
            default=None,
            description="1=Active, 2=Paused, -1/-2/-3=Errors"
        )
        provider_code: Optional[Literal[1, 2, 3, 4]] = Field(
            default=None,
            description="1=IMAP, 2=Google, 3=Microsoft, 4=AWS"
        )
        tag_ids: Optional[str] = Field(
            default=None,
            description="Comma-separated tag IDs"
        )
  • Registration of list_accounts within the ACCOUNT_TOOLS list, which is dynamically loaded and registered by the MCP server.
    ACCOUNT_TOOLS = [
        list_accounts,
        get_account,
        create_account,
        update_account,
        manage_account_state,
        delete_account,
    ]
  • MCP annotation registration for list_accounts indicating it is read-only.
    "list_accounts": {"readOnlyHint": True},
    "get_account": {"readOnlyHint": True},
Behavior4/5

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

The annotations declare readOnlyHint=true, and the description reinforces this by describing a listing operation. It adds valuable behavioral context beyond annotations: pagination mechanics (cursor-based, 100 per page), status code meanings, provider code mappings, and return content details (warmup status, campaign eligibility). This significantly enhances the agent's understanding of how the tool behaves.

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 efficiently structured with clear sections: purpose statement, pagination instructions, status codes, provider codes, and return content. Every sentence adds value - no redundant information. It's front-loaded with the core functionality and follows with essential operational details.

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, multiple parameter types, status codes), the description provides comprehensive context. With annotations covering safety (readOnlyHint=true) and an output schema existing, the description focuses on operational mechanics, code mappings, and return content - exactly what's needed for the agent to use the tool effectively.

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

Parameters4/5

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

With 0% schema description coverage, the description carries full burden for parameter understanding. It doesn't explicitly mention individual parameters like 'limit', 'starting_after', 'search', etc., but provides crucial semantic context: pagination cursor usage, status code meanings (1=Active, 2=Paused, -1/-2/-3=Errors), and provider code mappings (1=IMAP, 2=Google, 3=Microsoft, 4=AWS). This compensates well for the schema coverage gap.

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 ('List') and resource ('email accounts'), specifies cursor-based pagination with page size, and distinguishes from siblings like 'get_account' (singular) and 'create_account' (write operation). It provides specific scope details that differentiate it from other list tools.

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 about pagination mechanics and when to make subsequent calls, but doesn't explicitly state when to use this tool versus alternatives like 'get_account' for single accounts or 'search_campaigns_by_contact' for campaign-related queries. It offers good operational guidance but lacks sibling differentiation.

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