search-magazines
Search for magazines on note.com using keywords to find relevant publications and articles for research or reading purposes.
Instructions
マガジンを検索する
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | 検索キーワード | |
| size | No | 取得する件数(最大20) | |
| start | No | 検索結果の開始位置 |
Implementation Reference
- src/tools/search-tools.ts:154-179 (registration)Full registration of the 'search-magazines' tool, including description, Zod input schema (query: string, size: number default 10, start: number default 0), and handler. The handler calls note.com /v3/searches API with context=magazine, extracts data using safeExtractData and commonExtractors.magazines, formats with formatMagazine, and returns paginated results with total count.server.tool( "search-magazines", "マガジンを検索する", { query: z.string().describe("検索キーワード"), size: z.number().default(10).describe("取得する件数(最大20)"), start: z.number().default(0).describe("検索結果の開始位置"), }, async ({ query, size, start }) => { try { const data = await noteApiRequest(`/v3/searches?context=magazine&q=${encodeURIComponent(query)}&size=${size}&start=${start}`); const magazinesArray = safeExtractData(data, commonExtractors.magazines); const totalCount = safeExtractTotal(data, magazinesArray.length); const formattedMagazines = magazinesArray.map((magazine: any) => formatMagazine(magazine)); return createSuccessResponse({ total: totalCount, magazines: formattedMagazines }); } catch (error) { return handleApiError(error, "マガジン検索"); } } );
- src/tools/search-tools.ts:162-178 (handler)The core handler function for 'search-magazines' tool that performs the search API call, processes the response, formats magazines, and handles errors.async ({ query, size, start }) => { try { const data = await noteApiRequest(`/v3/searches?context=magazine&q=${encodeURIComponent(query)}&size=${size}&start=${start}`); const magazinesArray = safeExtractData(data, commonExtractors.magazines); const totalCount = safeExtractTotal(data, magazinesArray.length); const formattedMagazines = magazinesArray.map((magazine: any) => formatMagazine(magazine)); return createSuccessResponse({ total: totalCount, magazines: formattedMagazines }); } catch (error) { return handleApiError(error, "マガジン検索"); } }
- src/tools/search-tools.ts:157-161 (schema)Zod schema defining input parameters for the search-magazines tool.{ query: z.string().describe("検索キーワード"), size: z.number().default(10).describe("取得する件数(最大20)"), start: z.number().default(0).describe("検索結果の開始位置"), },
- src/tools/index.ts:17-17 (registration)Intermediate registration call within registerAllTools that includes search tools like search-magazines.registerSearchTools(server);
- src/note-mcp-server-refactored.ts:41-41 (registration)Top-level call to register all tools, which chains to search-magazines registration.registerAllTools(server);