list_kubernetes_versions
Retrieve available Kubernetes versions for cluster creation or upgrades 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)Tool handler in the switch statement that calls listAvailableVersions, formats the versions list, and returns the 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 metadata and input schema definition (no input parameters required).export const LIST_KUBERNETES_VERSIONS_TOOL: Tool = { name: 'list_kubernetes_versions', description: 'List available Kubernetes versions on Civo', inputSchema: { type: 'object', properties: {}, }, };
- src/api/kubernetes.ts:94-113 (helper)Core helper function that fetches the list of available Kubernetes versions from the Civo API.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(); }
- src/index.ts:86-90 (registration)Registration of Kubernetes tools, including list_kubernetes_versions, in the server capabilities.tools dictionary.[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, },