Skip to main content
Glama

notion_retrieve_bot_user

Retrieve the bot user details associated with your current Notion API token to identify and manage workspace access permissions.

Instructions

Retrieve the bot user associated with the current token in Notion

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
random_stringYesDummy parameter for no-parameter tools

Implementation Reference

  • Core handler implementation that performs the actual API call to retrieve the bot user from Notion's /users/me endpoint using the provided token.
    async retrieveBotUser(): Promise<UserResponse> { const response = await fetch(`${this.baseUrl}/users/me`, { method: "GET", headers: this.headers, }); return response.json(); }
  • Tool request dispatcher in the CallToolRequest handler that invokes the NotionClientWrapper's retrieveBotUser method.
    case "notion_retrieve_bot_user": { response = await notionClient.retrieveBotUser(); break; }
  • Schema definition for the tool, including name, description, and input schema (uses dummy parameter since no real args needed).
    export const retrieveBotUserTool: Tool = { name: "notion_retrieve_bot_user", description: "Retrieve the bot user associated with the current token in Notion", inputSchema: { type: "object", properties: { random_string: { type: "string", description: "Dummy parameter for no-parameter tools", }, format: formatParameter, }, required: ["random_string"], }, };
  • Registration of the tool in the ListToolsRequest handler by including retrieveBotUserTool in the list of available tools, which are filtered based on enabledToolsSet.
    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), }; });

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