Skip to main content
Glama

notion_list_all_users

Retrieve all users in a Notion workspace using this tool. Supports pagination and optional JSON or Markdown response formats. Requires Notion Enterprise plan and Organization API key.

Instructions

List all users in the Notion workspace. 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
page_sizeNoNumber of users to retrieve (max 100)
start_cursorNoPagination start cursor for listing users

Implementation Reference

  • Core handler implementation in NotionClientWrapper that calls the Notion /users API endpoint to list all users with pagination.
    async listAllUsers( start_cursor?: string, page_size?: number ): Promise<ListResponse> { const params = new URLSearchParams(); if (start_cursor) params.append("start_cursor", start_cursor); if (page_size) params.append("page_size", page_size.toString()); const response = await fetch(`${this.baseUrl}/users?${params.toString()}`, { method: "GET", headers: this.headers, }); return response.json(); }
  • Dispatch handler in the MCP server's CallToolRequest handler that routes 'notion_list_all_users' calls to the client wrapper.
    case "notion_list_all_users": { const args = request.params .arguments as unknown as args.ListAllUsersArgs; response = await notionClient.listAllUsers( args.start_cursor, args.page_size ); break; }
  • MCP Tool schema definition for notion_list_all_users, including input schema for pagination and format.
    export const listAllUsersTool: Tool = { name: "notion_list_all_users", description: "List all users in the Notion workspace. **Note:** This function requires upgrading to the Notion Enterprise plan and using an Organization API key to avoid permission errors.", inputSchema: { type: "object", properties: { start_cursor: { type: "string", description: "Pagination start cursor for listing users", }, page_size: { type: "number", description: "Number of users to retrieve (max 100)", }, format: formatParameter, }, }, };
  • Registration of the tool in the MCP server's ListToolsRequest handler by including listAllUsersTool in the allTools array.
    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 interface for tool arguments used in dispatch for type safety.
    export interface ListAllUsersArgs { start_cursor?: string; page_size?: number; 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/kimjungyeol/mcp-notion-server'

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