Skip to main content
Glama

liara_delete_mail_server

Remove a mail server from the Liara cloud platform by specifying its unique ID to manage your email infrastructure.

Instructions

Delete a mail server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mailIdYesThe mail server ID to delete

Implementation Reference

  • The main handler function that implements the logic to delete a mail server. It validates the mail server ID, creates a specialized mail client, and sends a DELETE request to the Liara Mail API endpoint `/v1/mails/{mailId}`.
    export async function deleteMailServer(
        client: LiaraClient,
        mailId: string
    ): Promise<void> {
        validateRequired(mailId, 'Mail server ID');
        const mailClient = createMailClient(client);
        await mailClient.delete(`/v1/mails/${mailId}`);
    }
  • Helper function that creates a specialized LiaraClient for the Mail service API with the correct baseURL 'https://mail-service.liara.ir/api'.
    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',
        });
    }
  • Type definition for MailServer used across mail operations, including potentially for listing or getting before deletion.
    export interface MailServer {
        _id: string;
        name: string;
        mode: 'DEV' | 'LIVE';
        status: 'ACTIVE' | 'INACTIVE';
        createdAt: string;
    }
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