get-likes
Retrieve all likes for a specific note.com article using the article ID to view engagement metrics and reader interactions.
Instructions
記事のスキ一覧を取得する
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| noteId | Yes | 記事ID |
Implementation Reference
- src/tools/note-tools.ts:83-98 (handler)The handler function for the 'get-likes' tool. It makes an API request to fetch likes for the specified noteId, formats the likes using formatLike, and returns a success response with the list of formatted likes or handles errors appropriately.async ({ noteId }) => { try { const data = await noteApiRequest(`/v3/notes/${noteId}/likes`); let formattedLikes: any[] = []; if (data.data && data.data.likes) { formattedLikes = data.data.likes.map(formatLike); } return createSuccessResponse({ likes: formattedLikes }); } catch (error) { return handleApiError(error, "スキ一覧取得"); } }
- src/tools/note-tools.ts:80-82 (schema)Zod schema defining the input parameters for the 'get-likes' tool: a required noteId string.{ noteId: z.string().describe("記事ID"), },
- src/tools/note-tools.ts:78-98 (registration)Direct registration of the 'get-likes' tool using server.tool() within the registerNoteTools function, including name, description, schema, and handler."get-likes", "記事のスキ一覧を取得する", { noteId: z.string().describe("記事ID"), }, async ({ noteId }) => { try { const data = await noteApiRequest(`/v3/notes/${noteId}/likes`); let formattedLikes: any[] = []; if (data.data && data.data.likes) { formattedLikes = data.data.likes.map(formatLike); } return createSuccessResponse({ likes: formattedLikes }); } catch (error) { return handleApiError(error, "スキ一覧取得"); } }
- src/utils/formatters.ts:127-133 (helper)Helper function formatLike used in the handler to standardize like data into id, user nickname, and creation time.export function formatLike(like: Like): FormattedLike { return { id: like.id || "", user: like.user?.nickname || "匿名ユーザー", createdAt: like.createdAt || "" }; }
- src/tools/index.ts:15-15 (registration)Calls registerNoteTools within registerAllTools to include note tools (including get-likes) in the MCP server.registerNoteTools(server);