Skip to main content
Glama

notion_create_comment

Add comments to Notion pages or discussion threads using rich text formatting. Simplify collaboration by enabling clear, structured feedback directly within your workspace.

Instructions

Create a comment in Notion. This requires the integration to have 'insert comment' capabilities. You can either specify a page parent or a discussion_id, but not both.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
discussion_idNoThe ID of an existing discussion thread to add a comment to.It should be a 32-character string (excluding hyphens) formatted as 8-4-4-4-12 with hyphens (-).
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
parentNoParent object that specifies the page to comment on. Must include a page_id if used.
rich_textYesArray of rich text objects representing the comment content.

Implementation Reference

  • The main handler function in NotionClientWrapper that performs the POST request to Notion's /comments endpoint to create a comment, constructing the body from parent, discussion_id, and rich_text.
    async createComment( parent?: { page_id: string }, discussion_id?: string, rich_text?: RichTextItemResponse[] ): Promise<CommentResponse> { const body: Record<string, any> = { rich_text }; if (parent) { body.parent = parent; } if (discussion_id) { body.discussion_id = discussion_id; } const response = await fetch(`${this.baseUrl}/comments`, { method: "POST", headers: this.headers, body: JSON.stringify(body), }); return response.json(); }
  • Defines the Tool schema for 'notion_create_comment', including name, description, and detailed inputSchema with properties for parent, discussion_id, rich_text, and format.
    export const createCommentTool: Tool = { name: "notion_create_comment", description: "Create a comment in Notion. This requires the integration to have 'insert comment' capabilities. You can either specify a page parent or a discussion_id, but not both.", inputSchema: { type: "object", properties: { parent: { type: "object", description: "Parent object that specifies the page to comment on. Must include a page_id if used.", properties: { page_id: { type: "string", description: "The ID of the page to comment on." + commonIdDescription, }, }, }, discussion_id: { type: "string", description: "The ID of an existing discussion thread to add a comment to." + commonIdDescription, }, rich_text: { type: "array", description: "Array of rich text objects representing the comment content.", items: richTextObjectSchema, }, format: formatParameter, }, required: ["rich_text"], }, };
  • In the MCP server tool request handler, the switch case for 'notion_create_comment' that validates arguments and delegates to the NotionClientWrapper's createComment method.
    case "notion_create_comment": { const args = request.params .arguments as unknown as args.CreateCommentArgs; if (!args.parent && !args.discussion_id) { throw new Error( "Either parent.page_id or discussion_id must be provided" ); } response = await notionClient.createComment( args.parent, args.discussion_id, args.rich_text ); break; }
  • Registers the createCommentTool schema in the list of available tools returned by ListToolsRequestHandler, filtered by enabledToolsSet.
    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/kimjungyeol/mcp-notion-server'

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