get-likes
Retrieve the list of likes for a specific note.com article by providing its article ID. This tool helps you view engagement metrics and track user interactions with your published content.
Instructions
記事のスキ一覧を取得する
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| noteId | Yes | 記事ID |
Implementation Reference
- src/tools/note-tools.ts:97-112 (handler)The core handler function for the 'get-likes' tool. It makes an API request to `/v3/notes/${noteId}/likes`, processes the likes data by mapping through `formatLike`, and returns a success response with the formatted likes list.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:94-96 (schema)Zod input schema for the 'get-likes' tool, requiring a 'noteId' string parameter.{ noteId: z.string().describe("記事ID"), },
- src/tools/note-tools.ts:91-113 (registration)The server.tool call that registers the 'get-likes' tool, including description, schema, and inline handler function.server.tool( "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/tools/index.ts:18-18 (registration)Higher-level registration call to registerNoteTools(server), which includes the get-likes tool among note-related tools.registerNoteTools(server);
- src/utils/formatters.ts:142-148 (helper)Helper function formatLike used in the handler to format individual like objects into {id, user, createdAt}.export function formatLike(like: Like): FormattedLike { return { id: like.id || "", user: like.user?.nickname || "匿名ユーザー", createdAt: like.createdAt || "" }; }