list_kubernetes_versions
Retrieve available Kubernetes versions for cluster creation or management on the Civo cloud platform.
Instructions
List available Kubernetes versions on Civo
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:549-564 (handler)The tool handler in the MCP server's CallToolRequest handler. It calls the listAvailableVersions helper, formats the versions into a string list, and returns a text response.case 'list_kubernetes_versions': { const versions = await listAvailableVersions(); const versionList = versions .map((v: any) => `${v.Version} - ${v.Label} (${v.Type}) [${v.ClusterType}]${v.Default ? ' *DEFAULT*' : ''}`) .join('\n'); return { content: [ { type: 'text', text: `Available Kubernetes Versions:\n${versionList}`, }, ], isError: false, }; }
- src/tools/kubernetes.ts:78-85 (schema)Tool definition including name, description, and empty input schema.export const LIST_KUBERNETES_VERSIONS_TOOL: Tool = { name: 'list_kubernetes_versions', description: 'List available Kubernetes versions on Civo', inputSchema: { type: 'object', properties: {}, }, };
- src/index.ts:86-89 (registration)Registration of Kubernetes tools, including list_kubernetes_versions, in the server's capabilities.tools map.[LIST_KUBERNETES_CLUSTERS_TOOL.name]: LIST_KUBERNETES_CLUSTERS_TOOL, [CREATE_KUBERNETES_CLUSTER_TOOL.name]: CREATE_KUBERNETES_CLUSTER_TOOL, [DELETE_KUBERNETES_CLUSTER_TOOL.name]: DELETE_KUBERNETES_CLUSTER_TOOL, [LIST_KUBERNETES_VERSIONS_TOOL.name]: LIST_KUBERNETES_VERSIONS_TOOL,
- src/api/kubernetes.ts:94-113 (helper)Core helper function that performs the HTTP GET request to Civo API to retrieve available Kubernetes versions.export async function listAvailableVersions(): Promise< CivoKubernetesVersion[] > { checkRateLimit(); const url = `${CIVO_API_URL}/kubernetes/versions`; const response = await fetch(url, { headers: { Authorization: `Bearer ${CIVO_API_KEY}`, }, }); if (!response.ok) { throw new Error( `Civo API error: ${response.status} ${response.statusText}` ); } return response.json(); }