Skip to main content
Glama

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
NameRequiredDescriptionDefault
volumeIdYesID of the volume to update
nameYesNew name for the volume

Implementation Reference

  • 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);
      }
    ),
  • 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
        );
      });
    } 
  • TypeScript interface defining the input structure for volume updates, used in repository and service layers.
    export interface VolumeUpdateInput {
      name: string;
    }
  • 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;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/epitaphe360/railway-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server