notion_retrieve_user
Retrieve a specific Notion user by ID using the Notion API. Requires an Organization API key and Enterprise plan access for permission management.
Instructions
Retrieve a specific user by user_id in Notion. Note: This function requires upgrading to the Notion Enterprise plan and using an Organization API key to avoid permission errors.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes | The ID of the user to retrieve.It should be a 32-character string (excluding hyphens) formatted as 8-4-4-4-12 with hyphens (-). | |
| format | No | Specify the response format. 'json' returns the original data structure, 'markdown' returns a more readable format. Use 'markdown' when the user only needs to read the page and isn't planning to write or modify it. Use 'json' when the user needs to read the page with the intention of writing to or modifying it. | markdown |
Implementation Reference
- src/client/index.ts:177-183 (handler)The actual implementation of retrieveUser method in NotionClientWrapper that makes a GET request to the Notion API's /users/{user_id} endpointasync retrieveUser(user_id: string): Promise<UserResponse> { const response = await fetch(`${this.baseUrl}/users/${user_id}`, { method: "GET", headers: this.headers, }); return response.json(); }
- src/server/index.ts:163-171 (registration)Tool registration and request handler that processes the notion_retrieve_user tool call, validates the user_id argument, and calls the client's retrieveUser methodcase "notion_retrieve_user": { const args = request.params .arguments as unknown as args.RetrieveUserArgs; if (!args.user_id) { throw new Error("Missing required argument: user_id"); } response = await notionClient.retrieveUser(args.user_id); break; }
- src/types/schemas.ts:217-232 (schema)Tool schema definition for notion_retrieve_user, defining the input parameters (user_id, optional format) and tool descriptionexport const retrieveUserTool: Tool = { name: "notion_retrieve_user", description: "Retrieve a specific user by user_id in Notion. **Note:** This function requires upgrading to the Notion Enterprise plan and using an Organization API key to avoid permission errors.", inputSchema: { type: "object", properties: { user_id: { type: "string", description: "The ID of the user to retrieve." + commonIdDescription, }, format: formatParameter, }, required: ["user_id"], }, };
- src/types/args.ts:64-67 (schema)TypeScript interface definition for the RetrieveUserArgs, specifying user_id as required and format as optionalexport interface RetrieveUserArgs { user_id: string; format?: "json" | "markdown"; }
- src/types/responses.ts:179-189 (schema)TypeScript type definition for UserResponse, describing the structure of the Notion API user object responseexport type UserResponse = { object: "user"; id: string; name?: string; avatar_url?: string | null; type?: "person" | "bot"; person?: { email: string; }; bot?: Record<string, any>; };