Skip to main content
Glama
tao12345666333

Civo MCP Server

shutdown_instance

Shutdown a cloud instance on Civo by providing the instance ID and region identifier to stop running virtual machines and manage cloud resources.

Instructions

Shutdown a cloud instance on Civo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInstance ID
regionYesRegion identifier

Implementation Reference

  • MCP server handler for the 'shutdown_instance' tool. Validates input arguments and calls the underlying shutdownInstance API function to execute the shutdown.
    case 'shutdown_instance': { if ( typeof args !== 'object' || args === null || typeof args.id !== 'string' || typeof args.region !== 'string' ) { throw new Error('Invalid arguments for shutdown_instance'); } const result = await shutdownInstance( args as { id: string; region: string } ); return { content: [ { type: 'text', text: `Instance ${args.id} shutdown: ${result.result}`, }, ], isError: false, }; }
  • Defines the Tool object for 'shutdown_instance', including name, description, and input schema for validation.
    export const SHUTDOWN_INSTANCE_TOOL: Tool = { name: 'shutdown_instance', description: 'Shutdown a cloud instance on Civo', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Instance ID', }, region: { type: 'string', description: 'Region identifier', }, }, required: ['id', 'region'], }, };
  • Core helper function that sends PUT request to Civo API to stop the instance.
    export async function shutdownInstance(params: { id: string; region: string; }): Promise<any> { checkRateLimit(); const url = `${CIVO_API_URL}/instances/${params.id}/stop`; const response = await fetch(url, { method: 'PUT', headers: { Authorization: `Bearer ${CIVO_API_KEY}`, }, body: new URLSearchParams({ region: params.region, }), }); if (!response.ok) { throw new Error( `Civo API error: ${response.status} ${response.statusText}` ); } return response.json(); }
  • src/index.ts:74-75 (registration)
    Registers the shutdown_instance tool in the MCP server's capabilities.tools dictionary.
    [SHUTDOWN_INSTANCE_TOOL.name]: SHUTDOWN_INSTANCE_TOOL, [START_INSTANCE_TOOL.name]: START_INSTANCE_TOOL,

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