add-magazine-note
Add articles to magazines on note.com by specifying magazine and article IDs for content organization and management.
Instructions
マガジンに記事を追加する
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| magazineId | Yes | マガジンID(例: mxxxx) | |
| noteId | Yes | 記事ID(例: nxxxx) |
Implementation Reference
- src/tools/magazine-tools.ts:42-56 (handler)The handler function for the 'add-magazine-note' tool. It checks authentication, makes a POST request to the API to add the note to the magazine, and returns a success response or handles errors.async ({ magazineId, noteId }) => { try { if (!hasAuth()) { return createAuthErrorResponse(); } const data = await noteApiRequest(`/v1/our/magazines/${magazineId}/notes`, "POST", { id: noteId }, true); return createSuccessResponse({ message: "マガジンに記事を追加しました", data: data }); } catch (error) { return handleApiError(error, "マガジンへの記事追加"); }
- src/tools/magazine-tools.ts:38-41 (schema)Zod input schema defining parameters: magazineId (string) and noteId (string) for the 'add-magazine-note' tool.{ magazineId: z.string().describe("マガジンID(例: mxxxx)"), noteId: z.string().describe("記事ID(例: nxxxx)") },
- src/tools/magazine-tools.ts:35-58 (registration)Local registration of the 'add-magazine-note' tool within registerMagazineTools using server.tool(name, description, schema, handler).server.tool( "add-magazine-note", "マガジンに記事を追加する", { magazineId: z.string().describe("マガジンID(例: mxxxx)"), noteId: z.string().describe("記事ID(例: nxxxx)") }, async ({ magazineId, noteId }) => { try { if (!hasAuth()) { return createAuthErrorResponse(); } const data = await noteApiRequest(`/v1/our/magazines/${magazineId}/notes`, "POST", { id: noteId }, true); return createSuccessResponse({ message: "マガジンに記事を追加しました", data: data }); } catch (error) { return handleApiError(error, "マガジンへの記事追加"); } } );
- src/tools/index.ts:18-18 (registration)Top-level registration call to registerMagazineTools in registerAllTools, which includes the 'add-magazine-note' tool.registerMagazineTools(server);