Skip to main content
Glama

get-comments

Retrieve all comments for a specific note.com article using the article ID to view user feedback and discussions.

Instructions

記事へのコメント一覧を取得する

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteIdYes記事ID

Implementation Reference

  • Registers the 'get-comments' MCP tool with input schema (noteId: string), description in Japanese, and inline handler that calls the Note.com API to fetch comments, formats them using formatComment helper, and returns success response with comment list.
    server.tool( "get-comments", "記事へのコメント一覧を取得する", { noteId: z.string().describe("記事ID"), }, async ({ noteId }) => { try { const data = await noteApiRequest(`/v1/note/${noteId}/comments`); let formattedComments: any[] = []; if (data.comments) { formattedComments = data.comments.map(formatComment); } return createSuccessResponse({ comments: formattedComments }); } catch (error) { return handleApiError(error, "コメント取得"); } } );
  • The core handler function for executing 'get-comments' tool logic: fetches comments via API for the given noteId, applies formatComment to each, and returns formatted list or handles errors.
    async ({ noteId }) => { try { const data = await noteApiRequest(`/v1/note/${noteId}/comments`); let formattedComments: any[] = []; if (data.comments) { formattedComments = data.comments.map(formatComment); } return createSuccessResponse({ comments: formattedComments }); } catch (error) { return handleApiError(error, "コメント取得"); }
  • Zod input schema for 'get-comments' tool: requires a single 'noteId' string parameter.
    { noteId: z.string().describe("記事ID"), },
  • Supporting helper function used by get-comments handler to standardize comment objects with id, body, user nickname, and publish date.
    export function formatComment(comment: Comment): FormattedComment { return { id: comment.id || "", body: comment.body || "", user: comment.user?.nickname || "匿名ユーザー", publishedAt: comment.publishAt || "" }; }

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