Skip to main content
Glama
code-alchemist01

MCP Cloud Services Server

gcp_list_cloud_functions

Retrieve all Google Cloud Functions in a specified GCP project and region to manage serverless resources.

Instructions

List all Cloud Functions in GCP

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoGCP project ID
regionNoGCP regionus-central1

Implementation Reference

  • Handler implementation for the 'gcp_list_cloud_functions' tool. It initializes the GCPAdapter and calls listCloudFunctions() on it, then formats the response.
    case 'gcp_list_cloud_functions': {
      const functions = await adapter.listCloudFunctions();
      return {
        total: functions.length,
        functions: functions.map((func) => ({
          id: func.id,
          name: func.functionName,
          runtime: func.runtime,
          region: func.region,
          status: func.status,
          availableMemoryMb: func.availableMemoryMb,
          timeout: func.timeout,
        })),
      };
    }
  • Schema definition for the 'gcp_list_cloud_functions' tool, including input parameters for projectId and region.
    {
      name: 'gcp_list_cloud_functions',
      description: 'List all Cloud Functions in GCP',
      inputSchema: {
        type: 'object',
        properties: {
          projectId: {
            type: 'string',
            description: 'GCP project ID',
          },
          region: {
            type: 'string',
            description: 'GCP region',
            default: 'us-central1',
          },
        },
      },
    },
  • src/server.ts:68-69 (registration)
    Registration and routing logic in the main MCP server: checks if tool name matches gcpTools and calls the corresponding handler.
    } else if (gcpTools.some((t) => t.name === name)) {
      result = await handleGCPTool(name, args || {});
  • Core helper method in GCPAdapter that implements the logic to list Cloud Functions. Currently a placeholder returning empty array, with comments for full implementation using @google-cloud/functions.
    async listCloudFunctions(): Promise<GCPCloudFunction[]> {
      await this.initializeClients();
      
      // Simplified implementation - would use Cloud Functions API in production
      // For now, return empty array as Cloud Functions client requires additional setup
      try {
        // In production, would use:
        // const { CloudFunctionsServiceClient } = await import('@google-cloud/functions');
        // this.functionsClient = new CloudFunctionsServiceClient();
        // const parent = `projects/${this.projectId}/locations/-`;
        // const [functionList] = await this.functionsClient.listFunctions({ parent });
        
        return [];
      } catch (error) {
        throw new Error(`Failed to list cloud functions: ${error instanceof Error ? error.message : String(error)}`);
      }
    }

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/code-alchemist01/Cloud-mcp_server'

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