aws_list_lambda_functions
Retrieve all AWS Lambda functions in a specified region to manage serverless resources and monitor deployments.
Instructions
List all Lambda functions in AWS
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "aws_list_lambda_functions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | AWS region | us-east-1 |
Implementation Reference
- src/adapters/aws-adapter.ts:177-206 (handler)Core handler implementation that initializes AWS LambdaClient, executes ListFunctionsCommand, maps AWS response to LambdaFunction objects, and handles errors.
async listLambdaFunctions(): Promise<LambdaFunction[]> { await this.initializeClients(); if (!this.lambdaClient) throw new Error('Lambda client not initialized'); try { const command = new ListFunctionsCommand({}); const response = await this.lambdaClient.send(command); const functions: LambdaFunction[] = []; for (const func of response.Functions || []) { functions.push({ id: func.FunctionArn || '', type: 'function', name: func.FunctionName || '', region: this.region, status: 'running', functionName: func.FunctionName || '', runtime: func.Runtime || '', memorySize: func.MemorySize, timeout: func.Timeout, lastModified: func.LastModified ? new Date(func.LastModified) : undefined, }); } return functions; } catch (error) { throw new Error(`Failed to list Lambda functions: ${error instanceof Error ? error.message : String(error)}`); } } - src/tools/aws-tools.ts:134-147 (handler)Tool-specific handler case within handleAWSTool that calls the AWS adapter and formats the response with total count and simplified function list.
case 'aws_list_lambda_functions': { const functions = await adapter.listLambdaFunctions(); return { total: functions.length, functions: functions.map((func) => ({ id: func.id, name: func.functionName, runtime: func.runtime, memorySize: func.memorySize, timeout: func.timeout, region: func.region, })), }; } - src/tools/aws-tools.ts:33-46 (registration)Tool registration entry in awsTools array, including name, description, and input schema for optional region parameter.
{ name: 'aws_list_lambda_functions', description: 'List all Lambda functions in AWS', inputSchema: { type: 'object', properties: { region: { type: 'string', description: 'AWS region', default: 'us-east-1', }, }, }, }, - src/types/index.ts:45-52 (schema)TypeScript interface defining the structure of LambdaFunction objects returned by the tool.
export interface LambdaFunction extends AWSResource { type: 'function'; functionName: string; runtime: string; memorySize?: number; timeout?: number; lastModified?: Date; } - src/server.ts:64-65 (registration)Top-level MCP server dispatch logic that identifies AWS tools and routes calls to handleAWSTool.
if (awsTools.some((t) => t.name === name)) { result = await handleAWSTool(name, args || {});