list-users
Retrieve all users from your Notion workspace to manage permissions and identify collaborators.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/lib/mcp-server.ts:569-594 (handler)The inline handler and registration for the 'list-users' MCP tool. It invokes NotionService.listUsers(), serializes the response as JSON text, and handles errors by returning an error message.this.server.tool("list-users", {}, async () => { try { const results = await this.notionService.listUsers(); return { content: [ { type: "text", text: JSON.stringify(results, null, 2), }, ], }; } catch (error) { console.error("Error in list-users tool:", error); return { content: [ { type: "text", text: `Error: Failed to list Notion users - ${ (error as Error).message }`, }, ], isError: true, }; } });
- src/lib/notion.ts:278-287 (helper)The NotionService.listUsers() method, which calls the underlying Notion Client's users.list() API with error handling via handleError./** * List all users */ async listUsers() { try { return await this.client.users.list({}); } catch (error) { this.handleError(error); } }
- src/lib/mcp-server.ts:44-44 (registration)High-level call to registerUserTools() within registerTools(), which includes the 'list-users' tool registration.this.registerUserTools();