volume_update
Modify volume properties in Railway infrastructure by changing the name or updating configurations to manage storage resources.
Instructions
Update a volume's properties
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| volumeId | Yes | ID of the volume to update | |
| name | Yes | New name for the volume |
Implementation Reference
- src/tools/volume.tool.ts:62-72 (handler)MCP tool 'volume_update' handler implementation: validates input with Zod schema and delegates to volumeService.updateVolume(volumeId, name). This is the core execution logic for the tool.createTool( "volume_update", "Update a volume's properties", { volumeId: z.string().describe("ID of the volume to update"), name: z.string().describe("New name for the volume") }, async ({ volumeId, name }) => { return volumeService.updateVolume(volumeId, name); } ),
- src/tools/index.ts:16-37 (registration)Registers all tools, including volumeTools containing 'volume_update', to the MCP server by spreading volumeTools into allTools and calling server.tool() for each.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/types.ts:363-365 (schema)TypeScript interface defining the input structure for volume updates, used in repository and service layers.export interface VolumeUpdateInput { name: string; }
- src/services/volume.service.ts:75-87 (helper)volumeService.updateVolume: wraps the repository call, handles errors, and formats the MCP CallToolResult response.async updateVolume(volumeId: string, name: string): Promise<CallToolResult> { try { const input = { name }; const volume = await this.client.volumes.updateVolume(volumeId, input); return createSuccessResponse({ text: `✅ Volume updated successfully to "${volume.name}" (ID: ${volume.id})`, data: volume }); } catch (error) { return createErrorResponse(`Error updating volume: ${formatError(error)}`); } }
- Repository layer GraphQL mutation execution for updating volume details.async updateVolume(volumeId: string, input: VolumeUpdateInput): Promise<Volume> { const data = await this.client.request<{ volumeUpdate: Volume }>(` mutation volumeUpdate($input: VolumeUpdateInput!, $volumeId: String!) { volumeUpdate(input: $input, volumeId: $volumeId) { createdAt id name projectId } } `, { input, volumeId }); return data.volumeUpdate; }