aws_start_ec2_instance
Start an AWS EC2 instance by providing the instance ID and optional region to launch cloud computing resources.
Instructions
Start an EC2 instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instanceId | Yes | EC2 instance ID | |
| region | No | AWS region |
Implementation Reference
- src/adapters/aws-adapter.ts:106-116 (handler)Core handler implementation: initializes AWS EC2 client with credentials and sends StartInstancesCommand to AWS to start the specified EC2 instance.async startEC2Instance(instanceId: string): Promise<void> { await this.initializeClients(); if (!this.ec2Client) throw new Error('EC2 client not initialized'); try { const command = new StartInstancesCommand({ InstanceIds: [instanceId] }); await this.ec2Client.send(command); } catch (error) { throw new Error(`Failed to start instance: ${error instanceof Error ? error.message : String(error)}`); } }
- src/tools/aws-tools.ts:165-169 (handler)Tool handler case in handleAWSTool function: extracts instanceId, calls AWSAdapter.startEC2Instance, and returns success message.case 'aws_start_ec2_instance': { const instanceId = params.instanceId as string; await adapter.startEC2Instance(instanceId); return { success: true, message: `Instance ${instanceId} started successfully` }; }
- src/tools/aws-tools.ts:61-78 (registration)Tool registration in awsTools array: defines name, description, and input schema for aws_start_ec2_instance.{ name: 'aws_start_ec2_instance', description: 'Start an EC2 instance', inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'EC2 instance ID', }, region: { type: 'string', description: 'AWS region', }, }, required: ['instanceId'], }, },
- src/tools/aws-tools.ts:64-76 (schema)Input schema definition for the tool, specifying required instanceId and optional region.inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'EC2 instance ID', }, region: { type: 'string', description: 'AWS region', }, }, required: ['instanceId'],
- src/server.ts:64-66 (registration)Top-level tool dispatch in MCP server: routes calls to aws_start_ec2_instance to handleAWSTool.if (awsTools.some((t) => t.name === name)) { result = await handleAWSTool(name, args || {}); } else if (azureTools.some((t) => t.name === name)) {