Skip to main content
Glama
code-alchemist01

MCP Cloud Services Server

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
NameRequiredDescriptionDefault
instanceIdYesEC2 instance ID
regionNoAWS region

Implementation Reference

  • 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)}`); } }
  • 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` }; }
  • 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'], }, },
  • 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)) {

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/code-alchemist01/Cloud-mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server