liara_list_buckets
Retrieve a list of storage buckets with pagination controls to manage object storage on the Liara cloud platform.
Instructions
List all storage buckets
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/storage.ts:14-23 (handler)The handler function listBuckets that lists all Liara buckets via the API, handling pagination and response unwrapping. This is the core implementation of the liara_list_buckets tool.* List all buckets */ export async function listBuckets( client: LiaraClient, pagination?: PaginationOptions ): Promise<Bucket[]> { const params = paginationToParams(pagination); const response = await client.get<any>('/v1/buckets', params); return unwrapApiResponse<Bucket[]>(response, ['buckets', 'data', 'items']); }
- src/api/types.ts:174-179 (schema)Type definition for Bucket, which is the return type of listBuckets.export interface Bucket { _id: string; name: string; region: string; createdAt: string; }
- src/api/types.ts:22-27 (schema)Input schema for pagination options accepted by listBuckets.export interface PaginationOptions { page?: number; perPage?: number; limit?: number; // Alternative to perPage offset?: number; // Alternative to page }
- src/services/storage.ts:20-22 (helper)Uses paginationToParams helper and unwrapApiResponse to process the API response.const params = paginationToParams(pagination); const response = await client.get<any>('/v1/buckets', params); return unwrapApiResponse<Bucket[]>(response, ['buckets', 'data', 'items']);