discord_list_members
Retrieve and display Discord server members with their assigned roles using guild ID and optional limit parameters.
Instructions
List guild members with their roles.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guild_id | Yes | ||
| limit | No | 1–1000, default 50. |
Implementation Reference
- src/tools/members.ts:93-103 (handler)The handler implementation for the 'discord_list_members' tool which fetches guild members and formats their details.
case "discord_list_members": { const guild = await discord.guilds.fetch(validateId(args.guild_id, "guild_id")); const limit = Math.min(Number(args.limit ?? 50), 1000); const members = await guild.members.list({ limit }); const result = [...members.values()].map((m: GuildMember) => ({ id: m.id, username: m.user.tag, nickname: m.nickname, roles: m.roles.cache.filter((r) => r.name !== "@everyone").map((r) => ({ id: r.id, name: r.name })), joinedAt: m.joinedAt?.toISOString(), })); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } - src/tools/members.ts:7-18 (schema)The definition and input schema for the 'discord_list_members' tool.
{ name: "discord_list_members", description: "List guild members with their roles.", inputSchema: { type: "object", properties: { guild_id: { type: "string" }, limit: { type: "number", description: "1–1000, default 50." }, }, required: ["guild_id"], }, },