Skip to main content
Glama

list_kubernetes_clusters

Retrieve all Kubernetes clusters in your Civo cloud account to monitor and manage your containerized applications.

Instructions

List all Kubernetes clusters on Civo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNoRegion identifier

Implementation Reference

  • The main handler for the 'list_kubernetes_clusters' tool within the CallToolRequestSchema switch statement. It invokes the listClusters helper, formats the cluster list as text, and returns the response.
    case 'list_kubernetes_clusters': { const clusters = await listClusters(args); const clusterList = clusters.items .map((c: any) => `${c.name} (${c.id}) - ${c.status}`) .join('\n'); return { content: [ { type: 'text', text: `Kubernetes Clusters:\n${clusterList}`, }, ], isError: false, }; }
  • Defines the tool schema including name, description, and inputSchema with optional 'region' parameter.
    export const LIST_KUBERNETES_CLUSTERS_TOOL: Tool = { name: 'list_kubernetes_clusters', description: 'List all Kubernetes clusters on Civo', inputSchema: { type: 'object', properties: { region: { type: 'string', description: 'Region identifier', }, }, }, };
  • src/index.ts:86-86 (registration)
    Registers the tool in the server capabilities.tools object for MCP protocol advertisement.
    [LIST_KUBERNETES_CLUSTERS_TOOL.name]: LIST_KUBERNETES_CLUSTERS_TOOL,
  • src/index.ts:113-113 (registration)
    Includes the tool in the list returned by ListToolsRequestHandler.
    LIST_KUBERNETES_CLUSTERS_TOOL,
  • API client helper that fetches the list of Kubernetes clusters from the Civo API, handling region param and rate limiting.
    export async function listClusters(params: { region?: string; }): Promise<CivoKubernetesClusterList> { checkRateLimit(); const url = new URL(`${CIVO_API_URL}/kubernetes/clusters`); if (params.region) url.searchParams.set('region', params.region); const response = await fetch(url.toString(), { headers: { Authorization: `Bearer ${CIVO_API_KEY}`, }, }); if (!response.ok) { throw new Error( `Civo API error: ${response.status} ${response.statusText}` ); } return response.json(); }

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/tao12345666333/civo-mcp'

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