Skip to main content
Glama

notion_retrieve_user

Retrieve specific user details from Notion using their user ID, supporting JSON or markdown formats for different use cases.

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
NameRequiredDescriptionDefault
formatNoSpecify 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_idYesThe 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

  • Exact implementation of the tool logic: makes a GET request to the Notion API endpoint `/users/{user_id}` to retrieve the user object.
    async retrieveUser(user_id: string): Promise<UserResponse> { const response = await fetch(`${this.baseUrl}/users/${user_id}`, { method: "GET", headers: this.headers, }); return response.json(); }
  • Tool schema definition including name, description, and input validation schema for notion_retrieve_user.
    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"], }, };
  • MCP server dispatch handler for the tool: extracts arguments, validates user_id, and invokes the Notion client method.
    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; }
  • Registers the tool by including it in the list of available tools returned in response to ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => { const 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), }; });
  • TypeScript type definition for the tool's input arguments.
    export interface RetrieveUserArgs { user_id: string; format?: "json" | "markdown"; }

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/suekou/mcp-notion-server'

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