liara_list_domains
Retrieve all domains associated with applications on the Liara cloud platform to manage DNS configurations and application routing.
Instructions
List all domains attached to apps
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (1-based) | |
| perPage | No | Number of items per page | |
| limit | No | Alternative to perPage: maximum number of items to return | |
| offset | No | Alternative to page: number of items to skip |
Implementation Reference
- src/services/domains.ts:13-20 (handler)Core handler function that implements the liara_list_domains tool logic. Calls Liara API /v1/domains endpoint with optional pagination and unwraps the response into Domain[] array.export async function listDomains( client: LiaraClient, pagination?: PaginationOptions ): Promise<Domain[]> { const params = paginationToParams(pagination); const response = await client.get<any>('/v1/domains', params); return unwrapApiResponse<Domain[]>(response, ['domains', 'data', 'items']); }
- src/api/types.ts:22-27 (schema)Input schema for pagination parameters accepted by liara_list_domains tool.export interface PaginationOptions { page?: number; perPage?: number; limit?: number; // Alternative to perPage offset?: number; // Alternative to page }
- src/api/types.ts:195-201 (schema)Output schema: Domain type returned by liara_list_domains tool, including DomainStatus enum.export interface Domain { _id: string; name: string; projectID: string; status: DomainStatus; createdAt: string; }
- src/api/types.ts:32-50 (helper)Helper function used by the handler to convert PaginationOptions to API query parameters.export function paginationToParams(options?: PaginationOptions): Record<string, any> { if (!options) return {}; const params: Record<string, any> = {}; if (options.page !== undefined) { params.page = options.page; } else if (options.offset !== undefined) { params.offset = options.offset; } if (options.perPage !== undefined) { params.perPage = options.perPage; } else if (options.limit !== undefined) { params.limit = options.limit; } return params; }
- src/services/domains.ts:2-7 (helper)Imports the necessary types and helpers for the domains service, including Domain schema and pagination support.import { Domain, DomainCheck, PaginationOptions, paginationToParams, } from '../api/types.js';