ack_list_clusters
List all Container Service for Kubernetes (ACK) clusters in your Alibaba Cloud account.
Instructions
List Container Service for Kubernetes (ACK) clusters.
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": "ack_list_clusters"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/ack/index.ts:27-30 (handler)The handler logic for ack_list_clusters: makes a GET request to '/api/v1/clusters' via the Alibaba Cloud ROAClient and returns the cluster list as formatted JSON text.
if (name === "ack_list_clusters") { const result = await client.request('GET', '/api/v1/clusters', {}, '', {}, {}); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } - src/tools/ack/index.ts:18-33 (handler)The handleAckTools function that dispatches to the ack_list_clusters handler based on the tool name. It creates an ROAClient with Alibaba Cloud credentials and endpoint.
export async function handleAckTools(name: string, args: any) { // @ts-ignore const client = new Core.ROAClient({ accessKeyId: config.ALIBABA_CLOUD_ACCESS_KEY_ID, accessKeySecret: config.ALIBABA_CLOUD_ACCESS_KEY_SECRET, endpoint: 'https://cs.aliyuncs.com', apiVersion: '2015-12-15', }); if (name === "ack_list_clusters") { const result = await client.request('GET', '/api/v1/clusters', {}, '', {}, {}); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } throw new Error(`Unknown ACK tool: ${name}`); } - src/tools/ack/index.ts:8-14 (schema)The tool registration schema for ack_list_clusters: defines the name, description, and an empty inputSchema (no required parameters).
name: "ack_list_clusters", description: "List Container Service for Kubernetes (ACK) clusters.", inputSchema: { type: "object", properties: {} } } - src/tools/ack/index.ts:5-16 (registration)The registerAckTools function that returns the tool definition array (currently containing only ack_list_clusters).
export function registerAckTools() { return [ { name: "ack_list_clusters", description: "List Container Service for Kubernetes (ACK) clusters.", inputSchema: { type: "object", properties: {} } } ]; } - src/index.ts:66-68 (registration)The dispatch logic in the main server that routes ack_ prefixed tool calls to handleAckTools, which includes ack_list_clusters.
if (name.startsWith("ack_")) { return await handleAckTools(name, args); }