liara_list_disks
Retrieve a list of disks associated with a specific application to manage storage resources and monitor usage.
Instructions
List disks for an app
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appName | Yes | The name of the app | |
| 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/disks.ts:14-34 (handler)Handler function that lists disks for a given Liara app/project by fetching project details via API and applying optional pagination client-side. This implements the core logic for the 'liara_list_disks' MCP tool.export async function listDisks( client: LiaraClient, appName: string, pagination?: PaginationOptions ): Promise<Disk[]> { validateAppName(appName); // Disks are included in project details, but we can still apply pagination client-side if needed const project = await client.get<any>(`/v1/projects/${appName}`); const disks = project.disks || []; // Apply client-side pagination if needed (since disks come from project details) if (pagination) { const page = pagination.page || 1; const perPage = pagination.perPage || pagination.limit || 100; const start = (page - 1) * perPage; const end = start + perPage; return disks.slice(start, end); } return disks; }
- src/api/types.ts:242-249 (schema)Type definitions for Disk (output) and CreateDiskRequest (related input schema). PaginationOptions imported and used for input schema.export interface Disk { _id: string; name: string; projectID: string; size: number; // in GB mountPath: string; createdAt: string; }