Skip to main content
Glama

get-user

Retrieve user details from Notion workspaces by providing a user ID to access profile information and permissions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesThe ID of the user to retrieve

Implementation Reference

  • Registration of the 'get-user' MCP tool, including inline Zod input schema and the handler function that delegates to NotionService.retrieveUser(user_id) and formats the JSON response or error.
    this.server.tool( "get-user", { user_id: z.string().describe("The ID of the user to retrieve"), }, async ({ user_id }) => { try { const result = await this.notionService.retrieveUser(user_id); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { console.error("Error in get-user tool:", error); return { content: [ { type: "text", text: `Error: Failed to retrieve Notion user - ${ (error as Error).message }`, }, ], isError: true, }; } } );
  • The NotionService.retrieveUser method, which implements the core logic by calling the Notion SDK's client.users.retrieve with the provided user_id.
    async retrieveUser(userId: string) { try { return await this.client.users.retrieve({ user_id: userId, }); } catch (error) { this.handleError(error); } }

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

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