Skip to main content
Glama

liara_get_mail_server

Retrieve mail server configuration details including settings and status for managing email infrastructure on the Liara cloud platform.

Instructions

Get details of a mail server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mailIdYesThe mail server ID

Implementation Reference

  • The core handler function that implements the logic to retrieve a specific mail server details from the Liara Mail API using the provided mail server ID.
    export async function getMailServer(
        client: LiaraClient,
        mailId: string
    ): Promise<MailServer> {
        validateRequired(mailId, 'Mail server ID');
        const mailClient = createMailClient(client);
        return await mailClient.get<MailServer>(`/v1/mails/${mailId}`);
    }
  • Type definition for the MailServer object, used as the return type for the getMailServer function.
    export interface MailServer {
        _id: string;
        name: string;
        mode: 'DEV' | 'LIVE';
        status: 'ACTIVE' | 'INACTIVE';
        createdAt: string;
    }
  • Helper function that creates a specialized LiaraClient instance configured for the Mail service API endpoint.
    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',
        });
    }
  • Validation helper used in the handler to ensure mailId is provided.
    export function validateRequired(value: any, fieldName: string): void {
        if (value === undefined || value === null || value === '') {
            throw new LiaraMcpError(`${fieldName} is required`);
        }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action. It doesn't describe what 'details' are returned, whether this is a read-only operation, what permissions are required, error conditions, or any rate limits. For a tool with no annotation coverage, this is insufficient.

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, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized for a simple retrieval tool and gets straight to the point.

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 tool with no annotations and no output schema, the description is too minimal. It doesn't explain what kind of details are returned, the format of the response, or any behavioral characteristics. Given the complexity of mail servers and the lack of structured metadata, the description should provide more context about the operation.

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 input schema has 100% description coverage, with the single parameter 'mailId' clearly documented as 'The mail server ID'. The description doesn't add any additional parameter information beyond what's already in the schema, which is acceptable given the high schema coverage.

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 verb ('Get details') and resource ('of a mail server'), making the purpose unambiguous. However, it doesn't distinguish this tool from its sibling 'liara_list_mail_servers' which likely lists multiple mail servers rather than getting details of a specific one.

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, when this tool is appropriate, or how it differs from the 'liara_list_mail_servers' sibling tool that appears to serve a related purpose.

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