list-rolebindings
View Kubernetes role bindings to manage access permissions in a specific namespace, helping administrators audit and control cluster security.
Instructions
List Kubernetes role bindings in a namespace
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-rolebindings"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | The namespace to list role bindings from (optional, defaults to current context namespace) |
Implementation Reference
- server.js:1933-1941 (handler)Handler implementation for the 'list-rolebindings' tool. Executes 'kubectl get rolebindings -o wide' with optional namespace flag and returns the stdout as text content.
case "list-rolebindings": { const { namespace } = args || {}; const nsArg = namespace ? `-n ${namespace}` : ""; const cmd = `kubectl get rolebindings ${nsArg} -o wide`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || "No role bindings found" }] }; } - server.js:835-845 (schema)Schema definition for the 'list-rolebindings' tool, including input schema for optional namespace parameter. This is part of the tools array used for tool listing and validation.
name: "list-rolebindings", description: "List Kubernetes role bindings in a namespace", inputSchema: { type: "object", properties: { namespace: { type: "string", description: "The namespace to list role bindings from (optional, defaults to current context namespace)" } } } - server.js:1392-1394 (registration)Registration of the tools list handler, which returns the array containing the 'list-rolebindings' tool schema when ListToolsRequest is called.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });