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;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'Delete' implying a destructive, irreversible mutation, but lacks critical details: whether it requires specific permissions, confirmation steps, rate limits, or what happens to associated data. For a deletion tool, this minimal description is insufficient for safe agent 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, direct sentence with zero wasted words—'Delete a mail server' efficiently conveys the core action and target. It's appropriately sized for a simple operation and front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a deletion tool with no annotations and no output schema, the description is incomplete. It doesn't address behavioral risks (e.g., irreversibility), success/failure responses, or dependencies on other tools. Given the complexity of a destructive operation and lack of structured safety hints, more context is needed for reliable agent use.

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?

The schema has 100% description coverage (parameter 'mailId' is documented as 'The mail server ID to delete'), so the baseline is 3. The description adds no additional parameter context beyond what the schema provides—it doesn't explain where to obtain the mailId or format requirements, though this is acceptable given the comprehensive schema.

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 action ('Delete') and resource ('a mail server'), making the purpose immediately understandable. It distinguishes from sibling tools like 'liara_get_mail_server' and 'liara_list_mail_servers' by specifying the destructive operation, though it doesn't explicitly contrast with other deletion tools (e.g., 'liara_delete_app').

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing a mail server ID from 'liara_list_mail_servers'), consequences of deletion, or when to choose other tools like 'liara_stop_mail_server' for temporary actions. This leaves the agent without context for proper tool 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/razavioo/liara-mcp'

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