list-clusterroles
Retrieve and display all Kubernetes cluster roles to manage access control and permissions across your cluster.
Instructions
List Kubernetes cluster roles
Input Schema
TableJSON 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 }; });