Skip to main content
Glama

delete_instance

Remove a cloud instance from the Civo platform by specifying its ID and region to manage infrastructure resources.

Instructions

Delete a cloud instance on Civo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInstance ID
regionYesRegion identifier

Implementation Reference

  • The core handler function that executes the deletion by making a DELETE request to the Civo API.
    export async function deleteInstance(params: { id: string; region: string; }): Promise<any> { checkRateLimit(); const url = new URL(`${CIVO_API_URL}/instances/${params.id}`); url.searchParams.set('region', params.region); const response = await fetch(url.toString(), { method: 'DELETE', 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 for 'delete_instance' including input validation schema.
    export const DELETE_INSTANCE_TOOL: Tool = { name: 'delete_instance', description: 'Delete a cloud instance on Civo', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Instance ID', }, region: { type: 'string', description: 'Region identifier', }, }, required: ['id', 'region'], }, };
  • src/index.ts:77-77 (registration)
    Registration of the delete_instance tool in the MCP server capabilities.tools map.
    [DELETE_INSTANCE_TOOL.name]: DELETE_INSTANCE_TOOL,
  • Dispatch handler in the CallToolRequestSchema that validates arguments and calls deleteInstance.
    case 'delete_instance': { if ( typeof args !== 'object' || args === null || typeof args.id !== 'string' || typeof args.region !== 'string' ) { throw new Error('Invalid arguments for delete_instance'); } const result = await deleteInstance( args as { id: string; region: string } ); return { content: [ { type: 'text', text: `Instance ${args.id} deleted: ${result.result}`, }, ], 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