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

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it's a list operation, implying it's read-only and non-destructive, but doesn't confirm this or add context like pagination behavior (implied by parameters), rate limits, authentication needs, or return format. For a tool with 4 parameters and no annotations, this leaves significant gaps in understanding how it behaves.

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 ('List all mail servers') with zero wasted words. It's front-loaded with the core action and resource, making it easy to scan and understand immediately. Every word earns its place by conveying essential purpose without redundancy.

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?

Given the tool's complexity (4 parameters, no annotations, no output schema), the description is incomplete. It lacks behavioral context (e.g., pagination defaults, error handling), usage guidelines, and details on return values. While the schema covers parameters well, the description doesn't add enough to help an agent invoke it correctly beyond the basic purpose.

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, fully documenting all 4 parameters (page, perPage, limit, offset) with clear meanings. The description adds no parameter information beyond what the schema provides, so it meets the baseline score of 3. However, it doesn't compensate for any gaps since there are none in the 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 verb ('List') and resource ('all mail servers'), making the purpose immediately understandable. It distinguishes itself from sibling tools like 'liara_get_mail_server' (singular) by indicating it returns multiple items. However, it doesn't explicitly differentiate from other list tools like 'liara_list_apps' or 'liara_list_domains' beyond the resource type.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing existing mail servers), exclusions (e.g., not for filtered searches), or comparisons to siblings like 'liara_get_mail_server' for single-server details. The agent must infer usage from the name and context alone.

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