Skip to main content
Glama

update-network-volume

Modify network volume properties such as name and storage capacity within the RunPod MCP Server environment. Change volume size or rename existing volumes to meet evolving storage requirements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoNew name for the network volume
networkVolumeIdYesID of the network volume to update
sizeNoNew size in GB (must be larger than current)

Implementation Reference

  • Handler function that performs a PATCH request to the RunPod API to update the network volume's name or size, and formats the response as text content.
    async (params) => { const { networkVolumeId, ...updateParams } = params; const result = await runpodRequest( `/networkvolumes/${networkVolumeId}`, 'PATCH', updateParams ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Input schema using Zod for validating parameters: networkVolumeId (required), name and size (optional).
    { networkVolumeId: z.string().describe('ID of the network volume to update'), name: z.string().optional().describe('New name for the network volume'), size: z .number() .optional() .describe('New size in GB (must be larger than current)'), },
  • src/index.ts:688-715 (registration)
    Registration of the 'update-network-volume' tool using server.tool(), including inline schema and handler.
    server.tool( 'update-network-volume', { networkVolumeId: z.string().describe('ID of the network volume to update'), name: z.string().optional().describe('New name for the network volume'), size: z .number() .optional() .describe('New size in GB (must be larger than current)'), }, async (params) => { const { networkVolumeId, ...updateParams } = params; const result = await runpodRequest( `/networkvolumes/${networkVolumeId}`, 'PATCH', updateParams ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } );
  • Shared helper function runpodRequest that makes authenticated HTTP requests to the RunPod API, used by the tool handler.
    async function runpodRequest( endpoint: string, method: string = 'GET', body?: Record<string, unknown> ) { const url = `${API_BASE_URL}${endpoint}`; const headers = { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json', }; const options: NodeFetchRequestInit = { method, headers, }; if (body && (method === 'POST' || method === 'PATCH')) { options.body = JSON.stringify(body); } try { const response = await fetch(url, options); if (!response.ok) { const errorText = await response.text(); throw new Error(`RunPod API Error: ${response.status} - ${errorText}`); } // Some endpoints might not return JSON const contentType = response.headers.get('content-type'); if (contentType && contentType.includes('application/json')) { return await response.json(); } return { success: true, status: response.status }; } catch (error) { console.error('Error calling RunPod API:', error); throw 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/runpod/runpod-mcp'

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