get-user-notes
Retrieve a user's published articles from note.com by providing their username, with optional pagination support for browsing through multiple pages of content.
Instructions
ユーザーの記事一覧を取得する
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | ユーザー名 | |
| page | No | ページ番号 |
Implementation Reference
- src/tools/user-tools.ts:39-66 (registration)Direct registration of the 'get-user-notes' tool on the MCP server, including description, input schema (username and page), and the handler function.server.tool( "get-user-notes", "ユーザーの記事一覧を取得する", { username: z.string().describe("ユーザー名"), page: z.number().default(1).describe("ページ番号"), }, async ({ username, page }) => { try { const data = await noteApiRequest(`/v2/creators/${username}/contents?kind=note&page=${page}`); let formattedNotes: any[] = []; if (data.data && data.data.contents) { formattedNotes = data.data.contents.map((note: any) => formatNote(note, username) ); } return createSuccessResponse({ total: data.data?.totalCount || 0, limit: data.data?.limit || 0, notes: formattedNotes }); } catch (error) { return handleApiError(error, "ユーザー記事一覧取得"); } } );
- src/tools/user-tools.ts:46-65 (handler)The execution handler for 'get-user-notes': fetches paginated list of user's notes from Note.com API, formats each note, and returns total count, limit, and formatted notes list.async ({ username, page }) => { try { const data = await noteApiRequest(`/v2/creators/${username}/contents?kind=note&page=${page}`); let formattedNotes: any[] = []; if (data.data && data.data.contents) { formattedNotes = data.data.contents.map((note: any) => formatNote(note, username) ); } return createSuccessResponse({ total: data.data?.totalCount || 0, limit: data.data?.limit || 0, notes: formattedNotes }); } catch (error) { return handleApiError(error, "ユーザー記事一覧取得"); } }
- src/tools/index.ts:16-16 (registration)Top-level tool registration function calls registerUserTools(server), which includes the registration of 'get-user-notes'.registerUserTools(server);