Skip to main content
Glama

liara_list_dns_records

Retrieve and view DNS records for a specific zone to manage domain configurations and troubleshoot connectivity issues.

Instructions

List DNS records for a zone

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zoneIdYesThe zone ID
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

  • The core handler function for listing DNS records in a Liara DNS zone. This implements the logic for the 'liara_list_dns_records' tool by calling the Liara API endpoint /v1/zones/{zoneId}/records.
    export async function listRecords(
        client: LiaraClient,
        zoneId: string,
        pagination?: PaginationOptions
    ): Promise<DnsRecord[]> {
        validateRequired(zoneId, 'Zone ID');
        const params = paginationToParams(pagination);
        const response = await client.get<any>(`/v1/zones/${zoneId}/records`, params);
        return unwrapApiResponse<DnsRecord[]>(response, ['records', 'data', 'items']);
    }
  • Type definitions for DNS records (output) and related types used by the DNS listing tool.
    export interface DnsRecord {
        _id: string;
        zoneID: string;
        type: DnsRecordType;
        name: string;
        value: string;
        ttl: number;
        priority?: number;
    }
  • Input schema for pagination options accepted by the list DNS records handler.
    export interface PaginationOptions {
        page?: number;
        perPage?: number;
        limit?: number; // Alternative to perPage
        offset?: number; // Alternative to page
    }
  • Helper function to unwrap paginated/list API responses, used in the DNS records listing handler.
    export function unwrapApiResponse<T>(response: any, expectedArrayKeys?: string[]): T {
        if (!response) return response;
        
        // If it's already the expected type (array or primitive), return as-is
        if (Array.isArray(response)) {
            return response as T;
        }
        
        // Common wrapper keys that APIs use
        const arrayKeys = expectedArrayKeys || ['data', 'items', 'results', 'projects', 'databases', 'buckets', 'zones', 'records', 'backups', 'releases', 'domains', 'vms', 'plans'];
        
        // Try to unwrap from common wrapper keys
        for (const key of arrayKeys) {
            if (response[key] !== undefined) {
                return response[key] as T;
            }
        }
        
        // Return as-is if no wrapper found
        return response as T;
    }
  • Liara API client class used by the DNS service handlers to make authenticated API calls.
    export class LiaraClient {
        private client: AxiosInstance;
        private teamId?: string;
        private maxRetries: number;
        private retryDelay: number;
    
        constructor(config: LiaraClientConfig) {
            const baseURL = config.baseURL || process.env.LIARA_API_BASE_URL || 'https://api.iran.liara.ir';
    
            this.client = axios.create({
                baseURL,
                headers: {
                    'Authorization': `Bearer ${config.apiToken}`,
                    'Content-Type': 'application/json',
                },
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. 'List DNS records' implies a read-only operation, but there's no information about authentication requirements, rate limits, pagination behavior (beyond what's in the schema), error conditions, or what format the returned data takes. The description doesn't add meaningful behavioral context beyond the basic operation name.

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 extremely concise - a single sentence that directly states the tool's purpose. There's zero wasted language, and the information is front-loaded. Every word earns its place in this minimal description.

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 list operation with 5 parameters and no output schema, the description is insufficient. It doesn't explain what the output looks like, how pagination works (despite having page/perPage/limit/offset parameters), or any constraints on the zoneId parameter. With no annotations and no output schema, the description should provide more context about the operation's behavior and results.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 ('List') and resource ('DNS records for a zone'), making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'liara_get_dns_record' which presumably retrieves a single record, leaving some ambiguity about when to use one versus the other.

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. With siblings like 'liara_get_dns_record' (likely for single records) and 'liara_list_zones' (for listing zones), there's no indication of when this list operation is appropriate versus other list or get operations in the same domain.

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