notion_retrieve_user
Retrieve user details from Notion using their user ID. Supports JSON for data manipulation or Markdown for readable output. Requires Notion Enterprise plan and Organization API key.
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/server/index.ts:148-156 (handler)MCP tool handler for 'notion_retrieve_user': validates user_id argument and delegates to NotionClientWrapper.retrieveUsercase "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:182-197 (schema)Tool schema definition for 'notion_retrieve_user' specifying input requirements (user_id) and 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/server/index.ts:303-325 (registration)Registration of 'notion_retrieve_user' tool via inclusion in allTools array returned by ListTools handlerconst allTools = [ schemas.appendBlockChildrenTool, schemas.retrieveBlockTool, schemas.retrieveBlockChildrenTool, schemas.deleteBlockTool, schemas.updateBlockTool, schemas.retrievePageTool, schemas.updatePagePropertiesTool, schemas.listAllUsersTool, schemas.retrieveUserTool, schemas.retrieveBotUserTool, schemas.createDatabaseTool, schemas.queryDatabaseTool, schemas.retrieveDatabaseTool, schemas.updateDatabaseTool, schemas.createDatabaseItemTool, schemas.createCommentTool, schemas.retrieveCommentsTool, schemas.searchTool, ]; return { tools: filterTools(allTools, enabledToolsSet), };
- src/client/index.ts:141-147 (helper)Core helper method in NotionClientWrapper that performs the actual Notion API GET request to /users/{user_id}async retrieveUser(user_id: string): Promise<UserResponse> { const response = await fetch(`${this.baseUrl}/users/${user_id}`, { method: "GET", headers: this.headers, }); return response.json(); }