list-clusterroles
Retrieve and display all Kubernetes cluster roles to manage access control and permissions across your cluster.
Instructions
List Kubernetes cluster roles
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-clusterroles"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:1943-1949 (handler)The handler function for the 'list-clusterroles' tool. It executes the kubectl command 'kubectl get clusterroles -o wide' and returns the output as text content or a fallback message if no output.
case "list-clusterroles": { const cmd = `kubectl get clusterroles -o wide`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || "No cluster roles found" }] }; } - server.js:847-853 (schema)The tool definition including name, description, and empty input schema (no parameters required) used for tool listing and validation.
{ name: "list-clusterroles", description: "List Kubernetes cluster roles", inputSchema: { type: "object", properties: {} } - server.js:1392-1394 (registration)Registration of the tool list handler, which returns the full tools array containing 'list-clusterroles' for tool discovery.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });