volume_update
Modify volume properties such as name using a structured input schema for managing Railway infrastructure efficiently.
Instructions
Update a volume's properties
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | New name for the volume | |
| volumeId | Yes | ID of the volume to update |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"name": {
"description": "New name for the volume",
"type": "string"
},
"volumeId": {
"description": "ID of the volume to update",
"type": "string"
}
},
"required": [
"volumeId",
"name"
],
"type": "object"
}
Implementation Reference
- src/tools/volume.tool.ts:62-72 (registration)Registration of the volume_update MCP tool via createTool. Includes tool name, description, Zod input schema (volumeId, name), and handler that calls volumeService.updateVolume.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/services/volume.service.ts:75-87 (handler)Handler logic in volumeService.updateVolume: prepares input, calls client API, formats success/error responses.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)}`); } }
- src/types.ts:363-365 (schema)Type definition for VolumeUpdateInput used in service/repo layers.export interface VolumeUpdateInput { name: string; }
- Repository helper: executes GraphQL mutation to update volume name.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; }
- src/tools/index.ts:32-36 (registration)Top-level registration of all tools including volumeTools (which contains volume_update) with the MCP server.allTools.forEach((tool) => { server.tool( ...tool ); });