reboot_instance
Restart a cloud instance on the Civo platform to resolve issues or apply configuration changes by specifying the instance ID and region.
Instructions
Reboot a cloud instance on Civo
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Instance ID | |
| region | Yes | Region identifier |
Implementation Reference
- src/api/instances.ts:71-95 (handler)Core handler function that executes the reboot_instance tool logic by sending a POST request to the Civo API to reboot the specified instance.export async function rebootInstance(params: { id: string; region: string; }): Promise<any> { checkRateLimit(); const url = `${CIVO_API_URL}/instances/${params.id}/reboots`; const response = await fetch(url, { method: 'POST', 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/tools/instances.ts:60-77 (schema)Schema definition for the reboot_instance tool, specifying input parameters and validation.export const REBOOT_INSTANCE_TOOL: Tool = { name: 'reboot_instance', description: 'Reboot 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:73-73 (registration)Registers the reboot_instance tool in the MCP server's capabilities.tools map.[REBOOT_INSTANCE_TOOL.name]: REBOOT_INSTANCE_TOOL,
- src/index.ts:231-253 (handler)MCP server request handler case for reboot_instance: validates arguments, calls the rebootInstance function, and returns the formatted response.case 'reboot_instance': { if ( typeof args !== 'object' || args === null || typeof args.id !== 'string' || typeof args.region !== 'string' ) { throw new Error('Invalid arguments for reboot_instance'); } const result = await rebootInstance( args as { id: string; region: string } ); return { content: [ { type: 'text', text: `Instance ${args.id} rebooted: ${result.result}`, }, ], isError: false, }; }
- src/index.ts:100-100 (registration)Includes the reboot_instance tool in the list returned by ListToolsRequest.REBOOT_INSTANCE_TOOL,