notion_retrieve_bot_user
Retrieve the bot user linked to the current Notion token in JSON or Markdown format, optimizing readability or integration for writing and modification tasks.
Instructions
Retrieve the bot user associated with the current token in Notion
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Specify 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_string | Yes | Dummy parameter for no-parameter tools |
Implementation Reference
- src/server/index.ts:158-161 (handler)MCP tool handler dispatch case that executes the tool by calling the NotionClientWrapper.retrieveBotUser() method.case "notion_retrieve_bot_user": { response = await notionClient.retrieveBotUser(); break; }
- src/client/index.ts:149-155 (helper)Core implementation in NotionClientWrapper that makes the Notion API GET request to /users/me to retrieve the bot user details.async retrieveBotUser(): Promise<UserResponse> { const response = await fetch(`${this.baseUrl}/users/me`, { method: "GET", headers: this.headers, }); return response.json(); }
- src/types/schemas.ts:199-214 (schema)Tool schema definition specifying name, description, and input schema (uses dummy required param since tool takes no real arguments).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"], }, };
- src/server/index.ts:302-326 (registration)Registers the tool by including its schema (schemas.retrieveBotUserTool) in the list of available tools served via ListToolsRequestHandler.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), }; });