Skip to main content
Glama

liara_create_mail_server

Create a new mail server on Liara cloud platform by specifying domain, plan, and mode for email hosting setup.

Instructions

Create a new mail server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoMail server name
modeNoMail server mode
planIDYesPlan ID for the mail server (required)
domainYesDomain name for the mail server (required)

Implementation Reference

  • The core handler function that implements the logic to create a new mail server on Liara by posting to the mail service API endpoint with validated parameters (domain required, planID required, mode defaults to DEV). Returns the created MailServer object.
     * Create a new mail server
     */
    export async function createMailServer(
        client: LiaraClient,
        _name: string,
        mode?: 'DEV' | 'LIVE',
        planID?: string,
        domain?: string
    ): Promise<MailServer> {
        // Note: '_name' parameter is kept for backward compatibility but not sent to API
        validateRequired(planID, 'Plan ID');
        validateRequired(domain, 'Domain');
        const requestBody: { mode?: 'DEV' | 'LIVE'; plan?: string; planID?: string; domain?: string } = { 
            domain: domain!,
        };
        if (mode) {
            requestBody.mode = mode;
        } else {
            // Default to 'DEV' if mode is not provided
            requestBody.mode = 'DEV';
        }
        if (planID) {
            requestBody.plan = planID;
            requestBody.planID = planID;
        }
        const mailClient = createMailClient(client);
        const response = await mailClient.post<any>('/v1/mails', requestBody);
        return unwrapApiResponse<MailServer>(response, ['mail', 'mailServer', 'data']);
    }
  • TypeScript interface defining the structure of a MailServer object, which is the output type of the createMailServer function.
    export interface MailServer {
        _id: string;
        name: string;
        mode: 'DEV' | 'LIVE';
        status: 'ACTIVE' | 'INACTIVE';
        createdAt: string;
    }
  • Helper function that creates a specialized LiaraClient for the Mail service API with the correct baseURL and inherited authentication.
    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',
        });
    }
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. 'Create a new mail server' implies a write/mutation operation, but it doesn't describe what happens after creation (e.g., does it return the server ID, is it immediately active, what permissions are needed, are there rate limits, or what happens if creation fails?). This leaves significant behavioral gaps for a creation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just four words, which is appropriately sized for a simple creation tool. It's front-loaded with the core action and resource, though it could potentially benefit from one more clarifying phrase. There's no wasted language, making it efficient.

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 creation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what the tool returns, what happens on success/failure, or any behavioral context. Given the complexity of creating infrastructure resources and the lack of structured metadata, the description should provide more complete operational context.

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 description coverage is 100%, so the schema already documents all four parameters (name, mode, planID, domain) with descriptions and required status. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Create a new mail server' clearly states the action (create) and resource (mail server), but it's vague about what a 'mail server' entails in this context and doesn't distinguish it from similar creation tools like liara_create_app or liara_create_database. It provides basic purpose but lacks specificity about the type of resource being created.

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 about when to use this tool versus alternatives. The description doesn't mention prerequisites, dependencies, or how this creation differs from other creation tools in the sibling list. There's no indication of when this should be used instead of other mail-related tools like liara_send_email or liara_list_mail_servers.

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