Skip to main content
Glama
jghidalgo

Lambda Performance MCP Server

by jghidalgo

list_lambda_functions

Retrieve all AWS Lambda functions in your account with basic performance information. Filter by runtime or include metrics to analyze function performance.

Instructions

List all Lambda functions in the account with basic performance info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
runtimeNoFilter by runtime (e.g., nodejs18.x, python3.9)
includeMetricsNoInclude basic performance metrics (default: false)

Implementation Reference

  • Main MCP tool handler for 'list_lambda_functions'. Parses input args, calls LambdaAnalyzer.listFunctions helper, and returns formatted markdown response with function list and optional metrics.
    async listLambdaFunctions(args) {
      const { runtime, includeMetrics = false } = args;
      
      const functions = await this.lambdaAnalyzer.listFunctions(runtime, includeMetrics);
    
      return {
        content: [
          {
            type: 'text',
            text: `# Lambda Functions\n\n` +
                  `## Summary\n` +
                  `- **Total Functions**: ${functions.length}\n` +
                  `- **Runtimes**: ${[...new Set(functions.map(f => f.runtime))].join(', ')}\n\n` +
                  `## Functions List\n` +
                  `${functions.map(func => 
                    `### ${func.name}\n` +
                    `- **Runtime**: ${func.runtime}\n` +
                    `- **Memory**: ${func.memory}MB\n` +
                    `- **Timeout**: ${func.timeout}s\n` +
                    `- **Last Modified**: ${func.lastModified}\n` +
                    `${includeMetrics ? 
                      `- **Avg Duration**: ${func.metrics?.avgDuration || 'N/A'}ms\n` +
                      `- **Cold Start Rate**: ${func.metrics?.coldStartRate || 'N/A'}%\n` +
                      `- **Error Rate**: ${func.metrics?.errorRate || 'N/A'}%\n` : ''}\n`
                  ).join('')}`
          }
        ]
      };
    }
  • Input schema defining parameters for the list_lambda_functions tool: optional runtime filter and includeMetrics flag.
    inputSchema: {
      type: 'object',
      properties: {
        runtime: {
          type: 'string',
          description: 'Filter by runtime (e.g., nodejs18.x, python3.9)'
        },
        includeMetrics: {
          type: 'boolean',
          description: 'Include basic performance metrics (default: false)'
        }
      }
    }
  • index.js:130-146 (registration)
    Registration of the list_lambda_functions tool in the ListToolsRequest handler response, providing name, description, and schema.
    {
      name: 'list_lambda_functions',
      description: 'List all Lambda functions in the account with basic performance info',
      inputSchema: {
        type: 'object',
        properties: {
          runtime: {
            type: 'string',
            description: 'Filter by runtime (e.g., nodejs18.x, python3.9)'
          },
          includeMetrics: {
            type: 'boolean',
            description: 'Include basic performance metrics (default: false)'
          }
        }
      }
    },
  • Helper method in LambdaAnalyzer that implements the core logic: lists all Lambda functions via AWS SDK, filters by runtime, enriches with config and optional performance metrics.
    async listFunctions(runtime, includeMetrics) {
      const command = new ListFunctionsCommand({});
      const response = await this.lambdaClient.send(command);
      
      let functions = response.Functions || [];
      
      if (runtime) {
        functions = functions.filter(func => func.Runtime === runtime);
      }
    
      const result = [];
      for (const func of functions) {
        const functionInfo = {
          name: func.FunctionName,
          runtime: func.Runtime,
          memory: func.MemorySize,
          timeout: func.Timeout,
          lastModified: func.LastModified
        };
    
        if (includeMetrics) {
          try {
            const quickAnalysis = await this.analyzeFunction(func.FunctionName, '24h', false);
            functionInfo.metrics = {
              avgDuration: quickAnalysis.avgDuration,
              coldStartRate: quickAnalysis.coldStartRate,
              errorRate: quickAnalysis.errorRate
            };
          } catch (error) {
            functionInfo.metrics = null;
          }
        }
    
        result.push(functionInfo);
      }
    
      return result;
    }
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 'basic performance info' but doesn't disclose behavioral traits such as pagination, rate limits, permissions required, or what 'basic' entails. This is inadequate for a tool with potential complexity in cloud environments.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. It avoids waste but could be slightly more structured for clarity, such as separating scope from output 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 no annotations, no output schema, and moderate complexity (listing cloud resources), the description is incomplete. It lacks details on return format, error handling, or behavioral constraints, leaving significant gaps for an AI agent to use the tool effectively.

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 already documents both parameters fully. The description adds no additional meaning beyond implying filtering and metrics inclusion, which the schema covers. 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.

Purpose4/5

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

The description clearly states the verb ('List') and resource ('Lambda functions in the account'), specifying scope ('all') and additional data ('basic performance info'). It distinguishes from siblings by focusing on listing rather than analysis, monitoring, or comparison, though it doesn't explicitly name alternatives.

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 siblings like 'analyze_lambda_performance' or 'monitor_real_time_performance'. The description implies it's for listing with basic info, but lacks explicit context, prerequisites, or exclusions for tool selection.

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/jghidalgo/lambda-performance-mcp-nodejs'

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