volume_list
Manage and audit persistent storage configurations by listing all volumes in a project. Use this tool to view data volumes, track storage usage, and prepare for volume creation.
Instructions
[API] List all volumes in a project
⚡️ Best for: ✓ Viewing persistent storage configurations ✓ Managing data volumes ✓ Auditing storage usage
→ Prerequisites: project_list
→ Next steps: volume_create
→ Related: service_info, database_deploy
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | ID of the project to list volumes for |
Implementation Reference
- src/tools/volume.tool.ts:25-27 (handler)The execution handler for the 'volume_list' tool, which invokes the volume service to list volumes for the given project.async ({ projectId }) => { return volumeService.listVolumes(projectId); }
- src/tools/volume.tool.ts:23-24 (schema)Zod input schema defining the required 'projectId' parameter for the tool.projectId: z.string().describe("ID of the project to list volumes for") },
- src/tools/volume.tool.ts:6-28 (registration)Registration of the 'volume_list' tool using createTool, including description, schema, and handler, added to volumeTools export.createTool( "volume_list", formatToolDescription({ type: 'API', description: "List all volumes in a project", bestFor: [ "Viewing persistent storage configurations", "Managing data volumes", "Auditing storage usage" ], relations: { prerequisites: ["project_list"], nextSteps: ["volume_create"], related: ["service_info", "database_deploy"] } }), { projectId: z.string().describe("ID of the project to list volumes for") }, async ({ projectId }) => { return volumeService.listVolumes(projectId); } ),
- src/tools/index.ts:16-37 (registration)Global registration function that includes volumeTools (containing volume_list) and registers all tools with the MCP server.export function registerAllTools(server: McpServer) { // Collect all tools const allTools = [ ...databaseTools, ...deploymentTools, ...domainTools, ...projectTools, ...serviceTools, ...tcpProxyTools, ...variableTools, ...configTools, ...volumeTools, ...templateTools, ] as Tool[]; // Register each tool with the server allTools.forEach((tool) => { server.tool( ...tool ); }); }
- src/services/volume.service.ts:16-39 (helper)Supporting service method that performs the actual volume listing, formatting, and error handling, called by the tool handler.async listVolumes(projectId: string): Promise<CallToolResult> { try { const volumes = await this.client.volumes.listVolumes(projectId); if (volumes.length === 0) { return createSuccessResponse({ text: "No volumes found in this project.", data: [] }); } const volumeDetails = volumes.map(volume => `📦 ${volume.name} (ID: ${volume.id}) Created: ${new Date(volume.createdAt).toLocaleString()}` ); return createSuccessResponse({ text: `Volumes in project:\n\n${volumeDetails.join('\n\n')}`, data: volumes }); } catch (error) { return createErrorResponse(`Error listing volumes: ${formatError(error)}`); } }