Skip to main content
Glama
tao12345666333

Civo MCP Server

get_disk_image

Retrieve detailed information about a specific disk image using its ID and region to manage cloud storage resources on the Civo platform.

Instructions

Get details of a specific disk image

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesDisk image ID
regionNoRegion identifier

Implementation Reference

  • Core implementation of the get_disk_image tool: fetches disk image details from Civo API using HTTP request.
    export async function getDiskImage(params: { id: string; region: string; }): Promise<CivoDiskImage> { checkRateLimit(); const url = new URL(`${CIVO_API_URL}/disk_images/${params.id}`); url.searchParams.set('region', params.region); const response = await fetch(url.toString(), { headers: { Authorization: `Bearer ${CIVO_API_KEY}`, }, }); if (!response.ok) { throw new Error( `Civo API error: ${response.status} ${response.statusText}` ); } return response.json(); }
  • Tool schema definition including name, description, and input validation schema for get_disk_image.
    export const GET_DISK_IMAGE_TOOL: Tool = { name: 'get_disk_image', description: 'Get details of a specific disk image', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Disk image ID', }, region: { type: 'string', description: 'Region identifier', }, }, required: ['id'], }, };
  • src/index.ts:70-89 (registration)
    Registration of all tools including get_disk_image in the MCP server capabilities.
    tools: { [CREATE_INSTANCE_TOOL.name]: CREATE_INSTANCE_TOOL, [LIST_INSTANCES_TOOL.name]: LIST_INSTANCES_TOOL, [REBOOT_INSTANCE_TOOL.name]: REBOOT_INSTANCE_TOOL, [SHUTDOWN_INSTANCE_TOOL.name]: SHUTDOWN_INSTANCE_TOOL, [START_INSTANCE_TOOL.name]: START_INSTANCE_TOOL, [RESIZE_INSTANCE_TOOL.name]: RESIZE_INSTANCE_TOOL, [DELETE_INSTANCE_TOOL.name]: DELETE_INSTANCE_TOOL, [LIST_DISK_IMAGES_TOOL.name]: LIST_DISK_IMAGES_TOOL, [GET_DISK_IMAGE_TOOL.name]: GET_DISK_IMAGE_TOOL, [LIST_SIZES_TOOL.name]: LIST_SIZES_TOOL, [LIST_REGIONS_TOOL.name]: LIST_REGIONS_TOOL, [LIST_NETWORKS_TOOL.name]: LIST_NETWORKS_TOOL, [CREATE_NETWORK_TOOL.name]: CREATE_NETWORK_TOOL, [RENAME_NETWORK_TOOL.name]: RENAME_NETWORK_TOOL, [DELETE_NETWORK_TOOL.name]: DELETE_NETWORK_TOOL, [LIST_KUBERNETES_CLUSTERS_TOOL.name]: LIST_KUBERNETES_CLUSTERS_TOOL, [CREATE_KUBERNETES_CLUSTER_TOOL.name]: CREATE_KUBERNETES_CLUSTER_TOOL, [DELETE_KUBERNETES_CLUSTER_TOOL.name]: DELETE_KUBERNETES_CLUSTER_TOOL, [LIST_KUBERNETES_VERSIONS_TOOL.name]: LIST_KUBERNETES_VERSIONS_TOOL,
  • MCP tool call handler for get_disk_image: validates input, invokes API function, formats and returns the response.
    case 'get_disk_image': { if ( typeof args !== 'object' || args === null || typeof args.id !== 'string' ) { throw new Error('Invalid arguments for get_disk_image'); } const image = await getDiskImage({ id: args.id as string, region: args.region as string, }); return { content: [ { type: 'text', text: 'Disk Image Details:\n' + `ID: ${image.id}\n` + `Name: ${image.name}\n` + `Version: ${image.version}\n` + `State: ${image.state}\n` + `Distribution: ${image.distribution}\n` + `Description: ${image.description || 'None'}\n` + `Label: ${image.label || 'None'}`, }, ], isError: false, }; }

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/tao12345666333/civo-mcp'

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