Skip to main content
Glama
eunyuljo

aws-helper MCP Server

by eunyuljo

get_ec2_instances

Retrieve AWS EC2 instances by region and state to monitor cloud infrastructure and manage resources.

Instructions

EC2 인스턴스 목록을 조회합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNoAWS 리전 (기본값: ap-northeast-2)ap-northeast-2
stateNo인스턴스 상태 필터 (running, stopped, pending 등)

Implementation Reference

  • The main handler function that fetches EC2 instances using AWS SDK's DescribeInstancesCommand, applies optional state filter, extracts relevant instance details, and returns formatted markdown text.
    async function getEC2Instances(args: any) {
      const region = args?.region || 'ap-northeast-2';
      const state = args?.state;
      
      const client = new EC2Client({ region });
      
      const filters = [];
      if (state) {
        filters.push({
          Name: 'instance-state-name',
          Values: [state]
        });
      }
      
      const command = new DescribeInstancesCommand({
        Filters: filters.length > 0 ? filters : undefined
      });
      
      const response = await client.send(command);
      
      const instances = [];
      for (const reservation of response.Reservations || []) {
        for (const instance of reservation.Instances || []) {
          const nameTag = instance.Tags?.find(tag => tag.Key === 'Name');
          instances.push({
            id: instance.InstanceId,
            name: nameTag?.Value || 'N/A',
            type: instance.InstanceType,
            state: instance.State?.Name,
            privateIp: instance.PrivateIpAddress,
            publicIp: instance.PublicIpAddress || 'N/A',
            launchTime: instance.LaunchTime?.toISOString(),
            az: instance.Placement?.AvailabilityZone
          });
        }
      }
      
      return {
        content: [
          {
            type: 'text',
            text: `📊 EC2 인스턴스 목록 (${region})\n\n` +
                  `총 ${instances.length}개 인스턴스\n\n` +
                  instances.map(i => 
                    `🖥️ **${i.name}** (${i.id})\n` +
                    `   상태: ${i.state}\n` +
                    `   타입: ${i.type}\n` +
                    `   Private IP: ${i.privateIp}\n` +
                    `   Public IP: ${i.publicIp}\n` +
                    `   가용영역: ${i.az}\n`
                  ).join('\n')
          }
        ]
      };
    }
  • Input schema defining optional 'region' (default 'ap-northeast-2') and 'state' (enum: running, stopped, pending, terminated) parameters for the tool.
    inputSchema: {
      type: 'object',
      properties: {
        region: {
          type: 'string',
          description: 'AWS 리전 (기본값: ap-northeast-2)',
          default: 'ap-northeast-2'
        },
        state: {
          type: 'string',
          description: '인스턴스 상태 필터 (running, stopped, pending 등)',
          enum: ['running', 'stopped', 'pending', 'terminated']
        }
      }
    }
  • src/index.ts:36-54 (registration)
    Tool metadata registration in ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: 'get_ec2_instances',
      description: 'EC2 인스턴스 목록을 조회합니다',
      inputSchema: {
        type: 'object',
        properties: {
          region: {
            type: 'string',
            description: 'AWS 리전 (기본값: ap-northeast-2)',
            default: 'ap-northeast-2'
          },
          state: {
            type: 'string',
            description: '인스턴스 상태 필터 (running, stopped, pending 등)',
            enum: ['running', 'stopped', 'pending', 'terminated']
          }
        }
      }
    },
  • src/index.ts:93-95 (registration)
    Switch case in CallToolRequestSchema handler that dispatches execution to the getEC2Instances function.
    case 'get_ec2_instances':
      return await getEC2Instances(args);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the action ('조회합니다' - retrieves/views), implying a read-only operation, but doesn't cover important aspects like authentication requirements, rate limits, pagination, error handling, or what the output looks like (e.g., list format, fields included).

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 in Korean that directly states the tool's purpose without any unnecessary words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

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?

Given the complexity of AWS EC2 operations and the lack of annotations and output schema, the description is insufficient. It doesn't explain the return values, error conditions, or behavioral traits like authentication needs. For a tool interacting with cloud resources, more context is needed for safe and effective use.

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?

The input schema has 100% description coverage, with clear documentation for both parameters (region and state). The description adds no additional parameter semantics beyond what the schema already provides, so it meets the baseline score of 3 for high schema coverage.

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 tool's purpose: 'EC2 인스턴스 목록을 조회합니다' translates to 'Retrieves a list of EC2 instances.' This is a specific verb+resource combination. However, it doesn't distinguish itself from sibling tools like get_ec2_summary, which might provide aggregated or different EC2 data.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like get_ec2_summary or get_aws_identity, nor does it specify any prerequisites, exclusions, or contextual triggers for usage.

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/eunyuljo/sample-mcp-server-with-claude-desktop'

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