Skip to main content
Glama

notion_list_all_users

Retrieve all users in a Notion workspace with pagination support and format options for viewing or processing user data.

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
start_cursorNoPagination start cursor for listing users
page_sizeNoNumber of users to retrieve (max 100)
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

Implementation Reference

  • Core implementation that executes the Notion API call to list all users (/users endpoint) with optional pagination parameters.
    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();
    }
  • MCP server handler dispatch for the tool: casts arguments and invokes the client method.
    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;
    }
  • Defines the MCP Tool object with name, description, and JSON input schema for validation.
    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,
        },
      },
    };
  • Registers the tool in the MCP ListToolsRequest handler by including it in the list of available tools.
    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),
      };
    });

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses the permission requirement (Enterprise plan, Organization API key), but does not mention other behaviors like pagination flow, rate limits, or error handling. Acceptable for a simple list tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences: first defines purpose, second provides critical dependency info. No redundant or unnecessary text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and the description covers purpose and a key requirement. Lacks mention of return format or response structure, but this is not essential given the tool's straightforward nature. Could be improved slightly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the description adds no additional meaning beyond what the schema already provides for all three parameters. Baseline score applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'List all users in the Notion workspace,' which is a specific verb+resource combination. It distinguishes from sibling tools like 'notion_retrieve_user' (single user) and 'notion_search' (general search).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a crucial usage note about requiring an Enterprise plan and Organization API key to avoid permission errors. This helps the agent know when this tool is appropriate, though it doesn't explicitly mention alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.