get-note
Retrieve detailed article information from note.com using the article ID to access content, metadata, and publication details.
Instructions
記事の詳細情報を取得する
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| noteId | Yes | 記事ID(例: n4f0c7b884789) |
Implementation Reference
- src/tools/note-tools.ts:26-47 (handler)The core handler function for the 'get-note' MCP tool. It constructs API parameters to fetch note details (including drafts), calls the note.com API, formats the response using formatNote helper, and returns a standardized success response or handles errors via handleApiError.async ({ noteId }) => { try { const params = new URLSearchParams({ draft: "true", draft_reedit: "false", ts: Date.now().toString() }); const data = await noteApiRequest( `/v3/notes/${noteId}?${params.toString()}`, "GET", null, true ); const noteData = data.data || {}; const formattedNote = formatNote(noteData); return createSuccessResponse(formattedNote); } catch (error) { return handleApiError(error, "記事取得"); }
- src/tools/note-tools.ts:23-25 (schema)Zod input schema definition for the 'get-note' tool, specifying the required 'noteId' parameter.{ noteId: z.string().describe("記事ID(例: n4f0c7b884789)"), },
- src/tools/note-tools.ts:20-49 (registration)Direct registration of the 'get-note' tool on the MCP server instance within registerNoteTools function. Includes name, Japanese description, input schema, and inline handler.server.tool( "get-note", "記事の詳細情報を取得する", { noteId: z.string().describe("記事ID(例: n4f0c7b884789)"), }, async ({ noteId }) => { try { const params = new URLSearchParams({ draft: "true", draft_reedit: "false", ts: Date.now().toString() }); const data = await noteApiRequest( `/v3/notes/${noteId}?${params.toString()}`, "GET", null, true ); const noteData = data.data || {}; const formattedNote = formatNote(noteData); return createSuccessResponse(formattedNote); } catch (error) { return handleApiError(error, "記事取得"); } } );
- src/tools/index.ts:15-15 (registration)Invocation of registerNoteTools within registerAllTools, which registers the get-note tool among others.registerNoteTools(server);