list_iam_users
Retrieve all IAM users from your AWS account to manage access permissions and audit user accounts.
Instructions
Lists IAM users in the AWS account.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:892-910 (handler)The handler function for the 'list_iam_users' tool. It sends a ListUsersCommand to the IAM client, maps the response to extract UserName, UserId, Arn, and CreateDate, and returns the JSON stringified list.if (name === "list_iam_users") { const command = new ListUsersCommand({}); const response = await iamClient.send(command); const users = response.Users?.map(u => ({ UserName: u.UserName, UserId: u.UserId, Arn: u.Arn, CreateDate: u.CreateDate })) || []; return { content: [ { type: "text", text: JSON.stringify(users, null, 2) } ] } }
- src/index.ts:132-138 (registration)Registration of the 'list_iam_users' tool in the ListToolsRequestHandler, including its name, description, and empty input schema (no parameters required).name: "list_iam_users", description: "Lists IAM users in the AWS account.", inputSchema: { type: "object", properties: {} } },
- src/index.ts:134-137 (schema)Input schema for 'list_iam_users' tool: an empty object, indicating no input parameters are needed.inputSchema: { type: "object", properties: {} }
- src/index.ts:55-55 (helper)Initialization of the IAMClient used by the list_iam_users handler.const iamClient = new IAMClient({});
- src/index.ts:21-21 (helper)Import of IAMClient and ListUsersCommand required for the list_iam_users tool implementation.import { IAMClient, ListUsersCommand, ListAccessKeysCommand, ListMFADevicesCommand } from "@aws-sdk/client-iam";