Skip to main content
Glama
code-alchemist01

MCP Cloud Services Server

aws_stop_ec2_instance

Stop an AWS EC2 instance to manage costs or perform maintenance by specifying the instance ID and optional region.

Instructions

Stop an EC2 instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceIdYesEC2 instance ID
regionNoAWS region

Implementation Reference

  • Handler logic for the 'aws_stop_ec2_instance' tool. Extracts the instanceId from input parameters, calls AWSAdapter.stopEC2Instance, and returns a success message.
    case 'aws_stop_ec2_instance': {
      const instanceId = params.instanceId as string;
      await adapter.stopEC2Instance(instanceId);
      return { success: true, message: `Instance ${instanceId} stopped successfully` };
    }
  • Input schema for the tool, requiring 'instanceId' and optionally accepting 'region'.
    inputSchema: {
      type: 'object',
      properties: {
        instanceId: {
          type: 'string',
          description: 'EC2 instance ID',
        },
        region: {
          type: 'string',
          description: 'AWS region',
        },
      },
      required: ['instanceId'],
    },
  • Tool registration definition including name, description, and schema, exported as part of awsTools array which is used in the main server.
    {
      name: 'aws_stop_ec2_instance',
      description: 'Stop an EC2 instance',
      inputSchema: {
        type: 'object',
        properties: {
          instanceId: {
            type: 'string',
            description: 'EC2 instance ID',
          },
          region: {
            type: 'string',
            description: 'AWS region',
          },
        },
        required: ['instanceId'],
      },
    },
  • Supporting method in AWSAdapter that performs the actual AWS API call to stop the EC2 instance using StopInstancesCommand.
    async stopEC2Instance(instanceId: string): Promise<void> {
      await this.initializeClients();
      if (!this.ec2Client) throw new Error('EC2 client not initialized');
    
      try {
        const command = new StopInstancesCommand({ InstanceIds: [instanceId] });
        await this.ec2Client.send(command);
      } catch (error) {
        throw new Error(`Failed to stop instance: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • src/server.ts:64-65 (registration)
    Routing logic in the main tool call handler that directs calls to 'aws_stop_ec2_instance' (via awsTools check) to the AWS-specific handleAWSTool function.
    if (awsTools.some((t) => t.name === name)) {
      result = await handleAWSTool(name, args || {});
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic action without behavioral details. It doesn't disclose permissions needed, whether the stop is reversible, potential costs or impacts, rate limits, or what happens to attached resources. For a destructive operation, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it immediately scannable and appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'stop' entails (e.g., graceful shutdown vs. force stop), return values, error conditions, or dependencies like IAM permissions. Given the complexity and lack of structured data, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are fully documented in the schema. The description adds no additional meaning about 'instanceId' or 'region' beyond what the schema provides, such as format examples or AWS-specific constraints. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Stop') and resource ('an EC2 instance'), making the purpose immediately understandable. It distinguishes from sibling tools like 'aws_start_ec2_instance' by specifying the opposite action, though it doesn't explicitly differentiate from generic 'stop_resource'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'stop_resource' or 'aws_start_ec2_instance'. The description lacks context about prerequisites (e.g., instance must be running), exclusions, or comparison with sibling tools, leaving usage decisions ambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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