n8n_list_users
Retrieve all user accounts from an n8n instance to manage access permissions and user administration.
Instructions
List all users in the n8n instance.
Args:
includeRole (boolean): Include user roles (default: true)
limit (number): Maximum results (default: 100)
cursor (string, optional): Pagination cursor
Returns: List of users with id, email, name, and role.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeRole | No | Include user roles in response | |
| limit | No | Maximum results to return | |
| cursor | No | Pagination cursor |
Implementation Reference
- src/tools/users-sourcecontrol.ts:62-87 (handler)The handler implementation for n8n_list_users.
async (params: z.infer<typeof ListUsersSchema>) => { const queryParams: Record<string, unknown> = { limit: params.limit, includeRole: params.includeRole }; if (params.cursor) queryParams.cursor = params.cursor; const response = await get<N8nPaginatedResponse<N8nUser>>('/users', queryParams); const formatted = response.data.map(formatUser).join('\n\n---\n\n'); const output = { count: response.data.length, users: response.data, nextCursor: response.nextCursor }; let text = `Found ${response.data.length} user(s):\n\n${formatted}`; if (response.nextCursor) { text += `\n\n_More results available. Use cursor: ${response.nextCursor}_`; } return { content: [{ type: 'text', text }], structuredContent: output }; } - src/tools/users-sourcecontrol.ts:41-61 (registration)Registration of the n8n_list_users tool.
server.registerTool( 'n8n_list_users', { title: 'List n8n Users', description: `List all users in the n8n instance. Args: - includeRole (boolean): Include user roles (default: true) - limit (number): Maximum results (default: 100) - cursor (string, optional): Pagination cursor Returns: List of users with id, email, name, and role.`, inputSchema: ListUsersSchema, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false } },