list_kubernetes_versions
Retrieve available Kubernetes versions from Civo for cluster provisioning and upgrades.
Instructions
List available Kubernetes versions on Civo
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_kubernetes_versions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/kubernetes.ts:78-85 (schema)Defines the tool schema/name for list_kubernetes_versions with no required input params
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:549-564 (handler)Handler case that calls listAvailableVersions API helper and formats 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/api/kubernetes.ts:94-113 (helper)Makes the actual API call to Civo's /kubernetes/versions endpoint and returns the version data
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/api/civo.ts:85-92 (schema)Type definition for the Kubernetes version objects returned by the API
export interface CivoKubernetesVersion { Version: string; Label: string; Type: string; Release: string; Default: boolean; ClusterType: string; } - src/index.ts:89-89 (registration)Registration of the tool in the server's tool list
[LIST_KUBERNETES_VERSIONS_TOOL.name]: LIST_KUBERNETES_VERSIONS_TOOL,