aws-mcp
run-aws-code
Run AWS code
Input Schema
Name | Required | Description | Default |
---|---|---|---|
code | Yes | Your job is to answer questions about AWS environment by writing Javascript code using AWS SDK V2. The code must be adhering to a few rules: - Must be preferring promises over callbacks - Think step-by-step before writing the code, approach it logically - MUST written in Javascript (NodeJS) using AWS-SDK V2 - Avoid hardcoded values like ARNs - Code written should be as parallel as possible enabling the fastest and the most optimal execution - Code should be handling errors gracefully, especially when doing multiple SDK calls (e.g. when mapping over an array). Each error should be handled and logged with a reason, script should continue to run despite errors - DO NOT require or import "aws-sdk", it is already available as "AWS" variable - Access to 3rd party libraries apart from "aws-sdk" is not allowed or possible - Data returned from AWS-SDK must be returned as JSON containing only the minimal amount of data that is needed to answer the question. All extra data must be filtered out - Code MUST "return" a value: string, number, boolean or JSON object. If code does not return anything, it will be considered as FAILED - Whenever tool/function call fails, retry it 3 times before giving up with an improved version of the code based on the returned feedback - When listing resources, ensure pagination is handled correctly so that all resources are returned - Do not include any comments in the code - When doing reduce, don't forget to provide an initial value - Try to write code that returns as few data as possible to answer without any additional processing required after the code is run - This tool can ONLY write code that interacts with AWS. It CANNOT generate charts, tables, graphs, etc. Please use artifacts for that instead Be concise, professional and to the point. Do not give generic advice, always reply with detailed & contextual data sourced from the current AWS environment. Assume user always wants to proceed, do not ask for confirmation. I'll tip you $200 if you do this right. | |
profileName | No | Name of the AWS profile to use | |
reasoning | Yes | The reasoning behind the code | |
region | No | Region to use (if not provided, us-east-1 is used) |