All integrations

AWS Lambda

Discover Lambda functions, inspect configuration and triggers, read resource policies, and invoke functions via MCP.

Manual setup 9 tools

Overview

Connect AWS Lambda so AI clients can discover functions, inspect configuration, versions, aliases, and event-source mappings, read resource policies, and invoke functions for testing.

This integration uses the AWS Lambda API with IAM access keys stored encrypted in stackgate.ai. Usage is billed to your AWS account.

For execution logs and errors, use the AWS CloudWatch integration with log group prefix /aws/lambda/{function-name}. To download deployment package bytes, use the code_location from get_function with the Amazon S3 integration.

Prerequisites

  • An AWS account with Lambda functions you want AI clients to access
  • A stackgate.ai account

Getting credentials

  1. In the AWS IAM console, create an IAM user (or use an existing automation user) with programmatic access.
  2. Attach a least-privilege policy. Example scoped to functions with a shared prefix:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "lambda:ListFunctions",
                "lambda:GetFunction",
                "lambda:GetFunctionConfiguration",
                "lambda:ListVersionsByFunction",
                "lambda:ListAliases",
                "lambda:ListEventSourceMappings",
                "lambda:GetEventSourceMapping",
                "lambda:GetPolicy",
                "lambda:InvokeFunction"
            ],
            "Resource": "arn:aws:lambda:YOUR-REGION:YOUR-ACCOUNT-ID:function:YOUR-PREFIX*"
        }
    ]
}
  1. Create an access key and copy the key ID and secret.
  2. In stackgate.ai, open My Integrations → AWS Lambda.
  3. Click Activate and enter access key ID, secret access key, AWS region, and optionally a default Lambda function name.

You can reuse the same IAM user across other stackgate.ai AWS integrations (CodeBuild, CloudWatch, S3, RDS) by combining policies.

Using with AI clients

  • Dedicated endpoint: POST /mcp/lambda with a Sanctum bearer token
  • Private gateway: one config for all integrations — use lambda__* namespaced tools

Typical workflow:

  1. list_functions — discover functions (or rely on default_function_name)
  2. get_function_configuration — runtime, memory, timeout, environment variables
  3. list_event_source_mappings — inspect SQS, DynamoDB, or Kinesis triggers
  4. invoke_function — test with a JSON payload (log_type: Tail for last 4 KB of execution log)
  5. CloudWatch — tail /aws/lambda/{function-name} for full execution logs

See Documentation for HTTP authentication and private gateway setup.

Troubleshooting

  • 422 integration not configured — complete all required credential fields in My Integrations.
  • 403 / AccessDenied from AWS — verify IAM policy includes the Lambda actions and function ARNs you need.
  • function_name is required — pass function_name or set a default function in My Integrations.
  • Invoke payload exceeds maximum size — reduce the JSON payload; the hub caps invoke payload size for MCP responses.
  • 429 / TooManyRequestsException — Lambda control-plane APIs share a 15 TPS limit per account/region; paginate with marker and avoid tight polling loops.
  • Invoke has side effectsinvoke_function runs real code in your AWS account; confirm with the user before calling production functions.

Available tools

  • list_functions

    List Lambda functions in the connected AWS account.

  • get_function_configuration

    Get configuration for a Lambda function: runtime, memory, timeout, environment, VPC, and layers.

  • get_function

    Get Lambda function details including configuration, deployment code location (S3), and tags.

  • list_versions_by_function

    List published versions of a Lambda function.

  • list_aliases

    List aliases for a Lambda function.

  • list_event_source_mappings

    List event source mappings (triggers) for Lambda functions.

  • get_event_source_mapping

    Get details for a Lambda event source mapping by UUID.

  • get_policy

    Get the resource-based policy for a Lambda function.

  • invoke_function

    Invoke a Lambda function synchronously or asynchronously with an optional JSON payload.

MCP endpoint: https://stackgate.ai/mcp/lambda (HTTP) or via the private gateway.