notion_retrieve_bot_user
Retrieve the bot user associated with the current Notion API token to identify the authenticated account for workspace interactions.
Instructions
Retrieve the bot user associated with the current token in Notion
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| random_string | Yes | Dummy parameter for no-parameter tools | |
| 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 |
Implementation Reference
- src/client/index.ts:185-191 (handler)The main handler implementation that executes the tool logic - makes a GET request to Notion's /users/me endpoint to retrieve the bot user associated with the current token.async retrieveBotUser(): Promise<UserResponse> { const response = await fetch(`${this.baseUrl}/users/me`, { method: "GET", headers: this.headers, }); return response.json(); }
- src/server/index.ts:173-176 (registration)The switch case that handles the tool invocation when 'notion_retrieve_bot_user' is called, executing the notionClient.retrieveBotUser() method.case "notion_retrieve_bot_user": { response = await notionClient.retrieveBotUser(); break; }
- src/server/index.ts:329-329 (registration)Registration of the tool schema in the allTools array that exposes the tool to the MCP server.schemas.retrieveBotUserTool,
- src/types/schemas.ts:234-249 (schema)Tool schema definition that defines the tool name 'notion_retrieve_bot_user', description, and input schema with a dummy parameter for no-parameter tools.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/types/args.ts:69-72 (schema)Type definition for RetrieveBotUserArgs interface defining the expected input arguments for the tool.export interface RetrieveBotUserArgs { random_string: string; format?: "json" | "markdown"; }