Skip to main content
Glama

list-gke-clusters

Retrieve all Google Kubernetes Engine clusters in your current GCP project to manage containerized applications and resources.

Instructions

List all GKE clusters in the current project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationNoLocation (region or zone) to list clusters from (defaults to all locations)

Implementation Reference

  • index.ts:171-184 (registration)
    Tool registration in the listTools response, including name, description, and input schema.
    { name: "list-gke-clusters", description: "List all GKE clusters in the current project", inputSchema: { type: "object", properties: { location: { type: "string", description: "Location (region or zone) to list clusters from (defaults to all locations)", } }, required: [], }, },
  • Zod schema for validating input arguments of the list-gke-clusters tool.
    const ListGKEClustersSchema = z.object({ location: z.string().optional(), });
  • Executes the list-gke-clusters tool: validates input, lists clusters using ClusterManagerClient.listClusters, formats output as JSON with cluster details.
    } else if (name === "list-gke-clusters") { const { location } = ListGKEClustersSchema.parse(args); if (!selectedProject) { return createTextResponse("No project selected. Please select a project first."); } try { const containerClient = new ClusterManagerClient(); const parent = location ? `projects/${selectedProject}/locations/${location}` : `projects/${selectedProject}/locations/-`; const [clusters] = await containerClient.listClusters({ parent }); return createTextResponse(JSON.stringify({ clusters: clusters.clusters?.map((cluster: any) => ({ name: cluster.name || null, location: cluster.location || null, status: cluster.status || null, nodeCount: cluster.currentNodeCount || null, k8sVersion: cluster.currentMasterVersion || null })) || [] }, null, 2)); } catch (error: any) { console.error('Error listing GKE clusters:', error); return createTextResponse(`Error listing GKE clusters: ${error.message}`); }

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/RadiumGu/gcp-ops-mcp'

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