notion_retrieve_user
Retrieve a specific user by ID from Notion, ensuring accurate data access. Requires an Organization API key and supports JSON or Markdown formats for response customization.
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 |
|---|---|---|---|
| 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 |
| 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 (-). |
Implementation Reference
- src/client/index.ts:141-147 (handler)Core implementation of the tool: makes HTTP GET request to Notion API /users/{user_id} to retrieve user details.async retrieveUser(user_id: string): Promise<UserResponse> { const response = await fetch(`${this.baseUrl}/users/${user_id}`, { method: "GET", headers: this.headers, }); return response.json(); }
- src/types/schemas.ts:182-197 (schema)Defines the Tool schema for notion_retrieve_user, including name, description, and input validation schema.export 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:148-156 (handler)Server-side dispatch handler for notion_retrieve_user: validates args and delegates to NotionClientWrapper.retrieveUser.case "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/server/index.ts:312-312 (registration)Registers the retrieveUserTool schema in the list of available tools returned by ListToolsRequest.schemas.retrieveUserTool,
- src/types/args.ts:57-60 (helper)TypeScript interface defining the arguments for the notion_retrieve_user tool.export interface RetrieveUserArgs { user_id: string; format?: "json" | "markdown"; }