Skip to main content
Glama

liara_list_mail_servers

Retrieve and display all configured mail servers for managing email infrastructure on the Liara cloud platform.

Instructions

List all mail servers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (1-based)
perPageNoNumber of items per page
limitNoAlternative to perPage: maximum number of items to return
offsetNoAlternative to page: number of items to skip

Implementation Reference

  • Core handler function implementing liara_list_mail_servers tool logic. Calls Liara Mail API to list servers with pagination support.
    /**
     * List all mail servers
     */
    export async function listMailServers(
        client: LiaraClient,
        pagination?: PaginationOptions
    ): Promise<MailServer[]> {
        const mailClient = createMailClient(client);
        const params = paginationToParams(pagination);
        const response = await mailClient.get<any>('/v1/mails', params);
        return unwrapApiResponse<MailServer[]>(response, ['mails', 'mailServers', 'data', 'items']);
    }
  • Output schema: MailServer interface defining the structure of each mail server returned by the tool.
    export interface MailServer {
        _id: string;
        name: string;
        mode: 'DEV' | 'LIVE';
        status: 'ACTIVE' | 'INACTIVE';
        createdAt: string;
    }
  • Input schema: PaginationOptions for optional pagination parameters in list requests.
    export interface PaginationOptions {
        page?: number;
        perPage?: number;
        limit?: number; // Alternative to perPage
        offset?: number; // Alternative to page
    }
  • Helper function to create a Mail-specific LiaraClient with correct baseURL and authentication.
     * Create a specialized Mail service client with the Mail API base URL
     */
    function createMailClient(client: LiaraClient): LiaraClient {
        // Access the internal client to get the API token
        const internalClient = (client as any).client;
        const apiToken = internalClient?.defaults?.headers?.Authorization?.replace('Bearer ', '') || 
                         process.env.LIARA_API_TOKEN;
        const teamId = (client as any).teamId || process.env.LIARA_TEAM_ID;
    
        if (!apiToken) {
            throw new Error('API token is required for Mail operations');
        }
    
        // Create new client with Mail service base URL
        return new LiaraClient({
            apiToken,
            teamId,
            baseURL: 'https://mail-service.liara.ir/api',
        });
    }
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/razavioo/liara-mcp'

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