Skip to main content
Glama

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
NameRequiredDescriptionDefault
noteIdYes記事ID

Implementation Reference

  • 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, "スキ一覧取得"); } }
  • Zod schema defining the input parameters for the 'get-likes' tool: a required noteId string.
    { noteId: z.string().describe("記事ID"), },
  • 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, "スキ一覧取得"); } }
  • 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 || "" }; }
  • Calls registerNoteTools within registerAllTools to include note tools (including get-likes) in the MCP server.
    registerNoteTools(server);

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