start_instance
Start a cloud instance on Civo by providing the instance ID and region identifier to activate the virtual server.
Instructions
Start 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:123-147 (handler)Core handler function that sends PUT request to Civo API to start the specified instance.export async function startInstance(params: { id: string; region: string; }): Promise<any> { checkRateLimit(); const url = `${CIVO_API_URL}/instances/${params.id}/start`; 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/tools/instances.ts:98-115 (schema)Tool schema defining input parameters (id, region) and description for start_instance.export const START_INSTANCE_TOOL: Tool = { name: 'start_instance', description: 'Start 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:279-301 (handler)MCP server handler for 'start_instance' tool: validates args and calls startInstance API function.case 'start_instance': { if ( typeof args !== 'object' || args === null || typeof args.id !== 'string' || typeof args.region !== 'string' ) { throw new Error('Invalid arguments for start_instance'); } const result = await startInstance( args as { id: string; region: string } ); return { content: [ { type: 'text', text: `Instance ${args.id} started: ${result.result}`, }, ], isError: false, }; }
- src/index.ts:75-75 (registration)Registration of start_instance tool schema in server capabilities.tools dictionary.[START_INSTANCE_TOOL.name]: START_INSTANCE_TOOL,