Skip to main content
Glama
rlymbur

Amazon VPC Lattice MCP Server

by rlymbur

vpc_lattice_cli

Manage and execute AWS CLI commands for VPC Lattice, including creating, updating, and deleting service networks, services, listeners, rules, and target groups, using specified AWS profiles and regions.

Instructions

Execute AWS CLI VPC Lattice commands

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoCommand arguments as key-value pairs
commandYesThe VPC Lattice subcommand to execute (e.g., create-service-network, list-service-networks)
profileNoAWS CLI profile to usedefault
regionNoAWS regionus-east-1

Implementation Reference

  • Handler implementation for the vpc_lattice_cli tool. Parses arguments, constructs AWS CLI command for vpc-lattice, spawns the process, captures output, and returns JSON result or errors.
    case 'vpc_lattice_cli': {
      const { command, args = {}, profile = 'default', region = 'us-east-1' } = request.params.arguments as {
        command: string;
        args?: Record<string, any>;
        profile?: string;
        region?: string;
      };
    
      // Convert args object to CLI arguments string
      const argsStr = Object.entries(args)
        .map(([key, value]) => {
          const cliKey = key.replace(/[A-Z]/g, letter => `-${letter.toLowerCase()}`);
          if (typeof value === 'boolean') {
            return value ? `--${cliKey}` : `--no-${cliKey}`;
          }
          if (Array.isArray(value)) {
            return `--${cliKey} ${value.join(',')}`;
          }
          return `--${cliKey} ${value}`;
        })
        .join(' ');
    
      // Construct and execute the AWS CLI command
      const { spawn } = await import('child_process');
      const awsProcess = spawn('aws', [
        'vpc-lattice',
        command,
        '--profile', profile,
        '--region', region,
        ...(argsStr ? argsStr.split(' ') : []),
        '--output', 'json'
      ]);
    
      return new Promise((resolve, reject) => {
        let stdout = '';
        let stderr = '';
    
        awsProcess.stdout.on('data', (data) => {
          stdout += data.toString();
        });
    
        awsProcess.stderr.on('data', (data) => {
          stderr += data.toString();
        });
    
        awsProcess.on('close', (code) => {
          if (code !== 0) {
            reject(new McpError(
              ErrorCode.InternalError,
              `AWS CLI command failed: ${stderr}`
            ));
            return;
          }
    
          try {
            const result = stdout ? JSON.parse(stdout) : {};
            resolve({
              content: [
                {
                  type: 'text',
                  text: JSON.stringify(result, null, 2)
                }
              ]
            });
          } catch (error) {
            reject(new McpError(
              ErrorCode.InternalError,
              `Failed to parse AWS CLI output: ${(error as Error).message}`
            ));
          }
        });
    
        awsProcess.on('error', (error) => {
          reject(new McpError(
            ErrorCode.InternalError,
            `Failed to execute AWS CLI command: ${(error as Error).message}`
          ));
        });
      });
    }
  • src/tools.ts:64-126 (registration)
    Tool registration in the tools array, including name, description, and input schema defining allowed commands and arguments.
    {
      name: 'vpc_lattice_cli',
      description: 'Execute AWS CLI VPC Lattice commands',
      inputSchema: {
        type: 'object',
        properties: {
          command: {
            type: 'string',
            description: 'The VPC Lattice subcommand to execute (e.g., create-service-network, list-service-networks)',
            enum: [
              'create-service-network',
              'delete-service-network',
              'get-service-network',
              'list-service-networks',
              'update-service-network',
              'create-service',
              'delete-service',
              'get-service',
              'list-services',
              'update-service',
              'create-listener',
              'delete-listener',
              'get-listener',
              'list-listeners',
              'update-listener',
              'create-rule',
              'delete-rule',
              'get-rule',
              'list-rules',
              'update-rule',
              'create-target-group',
              'delete-target-group',
              'get-target-group',
              'list-target-groups',
              'update-target-group',
              'register-targets',
              'deregister-targets',
              'list-targets',
              'list-tags-for-resource',
              'tag-resource',
              'untag-resource'
            ]
          },
          args: {
            type: 'object',
            description: 'Command arguments as key-value pairs',
            additionalProperties: true
          },
          profile: {
            type: 'string',
            description: 'AWS CLI profile to use',
            default: 'default'
          },
          region: {
            type: 'string',
            description: 'AWS region',
            default: 'us-east-1'
          }
        },
        required: ['command'],
        additionalProperties: false
      }
    }
  • Input schema for vpc_lattice_cli tool, specifying command enum, args object, optional profile and region.
    inputSchema: {
      type: 'object',
      properties: {
        command: {
          type: 'string',
          description: 'The VPC Lattice subcommand to execute (e.g., create-service-network, list-service-networks)',
          enum: [
            'create-service-network',
            'delete-service-network',
            'get-service-network',
            'list-service-networks',
            'update-service-network',
            'create-service',
            'delete-service',
            'get-service',
            'list-services',
            'update-service',
            'create-listener',
            'delete-listener',
            'get-listener',
            'list-listeners',
            'update-listener',
            'create-rule',
            'delete-rule',
            'get-rule',
            'list-rules',
            'update-rule',
            'create-target-group',
            'delete-target-group',
            'get-target-group',
            'list-target-groups',
            'update-target-group',
            'register-targets',
            'deregister-targets',
            'list-targets',
            'list-tags-for-resource',
            'tag-resource',
            'untag-resource'
          ]
        },
        args: {
          type: 'object',
          description: 'Command arguments as key-value pairs',
          additionalProperties: true
        },
        profile: {
          type: 'string',
          description: 'AWS CLI profile to use',
          default: 'default'
        },
        region: {
          type: 'string',
          description: 'AWS region',
          default: 'us-east-1'
        }
      },
      required: ['command'],
      additionalProperties: false
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'execute' which implies mutation, but doesn't disclose behavioral traits like which commands are destructive (e.g., delete-*), authentication needs, error handling, or output format. This is a significant gap for a CLI tool with potentially destructive operations.

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 appropriately sized and front-loaded, clearly stating the tool's function without unnecessary details.

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 (4 parameters, no annotations, no output schema, and a wide range of commands including destructive ones), the description is incomplete. It lacks context on safety, output, error cases, or how to interpret results, making it inadequate for effective tool 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?

Schema description coverage is 100%, so the schema fully documents parameters. The description adds no meaning beyond the schema—it doesn't explain parameter relationships, command-argument mappings, or usage examples. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose3/5

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

The description 'Execute AWS CLI VPC Lattice commands' states the action (execute) and target (AWS CLI VPC Lattice commands), but is vague about what VPC Lattice is and doesn't differentiate from sibling tools like get_amazon_vpc_lattice_prompts or list_amazon_vpc_lattice_prompts. It provides a basic purpose but lacks specificity about the resource domain.

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. The description doesn't mention sibling tools, prerequisites like AWS credentials, or typical use cases. Usage is implied only through the command enum in the schema, not in the description itself.

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

Related 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/rlymbur/amazon-vpc-lattice-mcp-server'

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