Skip to main content
Glama

list-users

Retrieve all users from your n8n instance securely using the MCP server, available exclusively to the instance owner. Requires clientId for authentication.

Instructions

Retrieve all users from your instance. Only available for the instance owner.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes

Implementation Reference

  • The handler function for the 'list-users' tool in the CallToolRequestSchema switch statement. It retrieves the N8nClient instance using the provided clientId, calls listUsers() on it, and returns the formatted list of users or an error.
    case "list-users": { const { clientId } = args as { clientId: string }; const client = clients.get(clientId); if (!client) { return { content: [{ type: "text", text: "Client not initialized. Please run init-n8n first.", }], isError: true }; } try { const users = await client.listUsers(); return { content: [{ type: "text", text: JSON.stringify(users.data, null, 2), }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; } }
  • src/index.ts:556-565 (registration)
    The registration of the 'list-users' tool in the tools array returned by the ListToolsRequestSchema handler, including its name, description, and input schema.
    name: "list-users", description: "Retrieve all users from your instance. Only available for the instance owner.", inputSchema: { type: "object", properties: { clientId: { type: "string" } }, required: ["clientId"] } },
  • The input schema definition for the 'list-users' tool, specifying the required clientId parameter.
    inputSchema: { type: "object", properties: { clientId: { type: "string" } }, required: ["clientId"] }
  • The helper method in N8nClient class that makes the API request to '/users' to list users, called by the tool handler.
    return this.makeRequest<N8nUserList>('/users'); }
  • Type definition for the response from listUsers API.
    interface N8nUserList { data: N8nUser[]; nextCursor?: string; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/illuminaresolutions/n8n-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server