Skip to main content
Glama

post-comment

Add comments to note.com articles by providing the article ID and comment text to engage with content and participate in discussions.

Instructions

記事にコメントを投稿する

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteIdYes記事ID
textYesコメント本文

Implementation Reference

  • Registration of the 'post-comment' MCP tool including Zod input schema (noteId: string, text: string) and the execution handler that authenticates, posts the comment via the note API, and returns a formatted success/error response.
    server.tool( "post-comment", "記事にコメントを投稿する", { noteId: z.string().describe("記事ID"), text: z.string().describe("コメント本文"), }, async ({ noteId, text }) => { try { if (!hasAuth()) { return createAuthErrorResponse(); } const data = await noteApiRequest(`/v1/note/${noteId}/comments`, "POST", { text }, true); return createSuccessResponse({ message: "コメントを投稿しました", data: data }); } catch (error) { return handleApiError(error, "コメント投稿"); } } ); // 6. スキをつけるツール
  • The core handler logic for 'post-comment' tool: authenticates user, sends POST request to note.com API endpoint `/v1/note/{noteId}/comments` with body `{ text }`, handles response or error with standardized success/error creators.
    "記事にコメントを投稿する", { noteId: z.string().describe("記事ID"), text: z.string().describe("コメント本文"), }, async ({ noteId, text }) => { try { if (!hasAuth()) { return createAuthErrorResponse(); } const data = await noteApiRequest(`/v1/note/${noteId}/comments`, "POST", { text }, true); return createSuccessResponse({ message: "コメントを投稿しました", data: data }); } catch (error) { return handleApiError(error, "コメント投稿"); } } ); // 6. スキをつけるツール
  • Zod schema for 'post-comment' tool inputs: noteId (string, article ID), text (string, comment body).
    text: z.string().describe("コメント本文"), }, async ({ noteId, text }) => { try {
  • Alternative direct handler for 'post-comment' in HTTP transport implementation (note: uses 'comment' param instead of 'text'), calls same API endpoint, returns raw JSON in MCP content format.
    } else if (name === "post-comment") { // post-commentツールの実装 const { noteId, comment } = args; const data = await noteApiRequest( `/v1/note/${noteId}/comments`, "POST", { comment: comment }, true ); result = { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
  • JSON Schema definition for 'post-comment' tool in HTTP server tools list (noteId: string, comment: string). Used for tools/list response.
    name: "post-comment", description: "記事にコメントを投稿", inputSchema: { type: "object", properties: { noteId: { type: "string", description: "記事ID" }, comment: { type: "string", description: "コメント内容" } }, required: ["noteId", "comment"] }

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/shimayuz/note-com-mcp'

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