Skip to main content
Glama

volume_delete

Delete unused storage volumes to optimize resource management and cleanup in Railway infrastructure. Ideal for permanent data removal after ensuring backups via volume_backup.

Instructions

[API] Delete a volume from a service

⚡️ Best for: ✓ Removing unused storage ✓ Storage cleanup ✓ Resource management

⚠️ Not for: × Temporary data removal × Data backup (use volume_backup first)

→ Prerequisites: volume_list

→ Related: service_update

Input Schema

NameRequiredDescriptionDefault
volumeIdYesID of the volume to delete

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "volumeId": { "description": "ID of the volume to delete", "type": "string" } }, "required": [ "volumeId" ], "type": "object" }

Implementation Reference

  • The tool handler function that delegates volume deletion to the volumeService.
    return volumeService.deleteVolume(volumeId); } )
  • Zod schema defining the input parameter 'volumeId' for the volume_delete tool.
    volumeId: z.string().describe("ID of the volume to delete") }, async ({ volumeId }) => {
  • The createTool invocation that defines and registers the volume_delete tool with its name, description, input schema, and handler.
    createTool( "volume_delete", formatToolDescription({ type: 'API', description: "Delete a volume from a service", bestFor: [ "Removing unused storage", "Storage cleanup", "Resource management" ], notFor: [ "Temporary data removal", "Data backup (use volume_backup first)" ], relations: { prerequisites: ["volume_list"], related: ["service_update"] } }), { volumeId: z.string().describe("ID of the volume to delete") }, async ({ volumeId }) => { return volumeService.deleteVolume(volumeId); } )
  • The registration function that adds all tools, including volume_delete via volumeTools, to 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 ); }); }
  • Supporting service method that performs the volume deletion using the API client and formats the response.
    async deleteVolume(volumeId: string): Promise<CallToolResult> { try { const success = await this.client.volumes.deleteVolume(volumeId); if (success) { return createSuccessResponse({ text: "✅ Volume deleted successfully", data: { success } }); } else { return createErrorResponse("Failed to delete volume"); } } catch (error) { return createErrorResponse(`Error deleting volume: ${formatError(error)}`); } }

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/jason-tan-swe/railway-mcp'

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