search_book
Search and retrieve book results from Naver's database. Specify queries, sort by relevance or date, and control display count and start position.
Instructions
Perform a search on Naver Book. (네이버 책 검색)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| display | No | Number of results to display (default: 10) | |
| query | Yes | Search query | |
| sort | No | Sort method (sim: similarity, date: date) | |
| start | No | Start position of search results (default: 1) |
Implementation Reference
- src/handlers/search.handlers.ts:64-69 (handler)Core handler function that executes the book search using NaverSearchClient.search('book', params). This is the exact implementation of the tool logic./** * 도서 검색 핸들러 */ export async function handleBookSearch(params: SearchArgs) { return client.search("book", params); }
- src/index.ts:192-205 (registration)MCP server registration of the 'search_book' tool, specifying name, description, input schema, and handler that delegates to searchToolHandlers.search_book.server.registerTool( "search_book", { description: "📚 Search for books, publications, and literary content. Find book reviews, author information, publication details, and reading recommendations in Korean literature and translated works. For new releases or current bestsellers, use get_current_korean_time first. (네이버 책 검색 - 도서 정보와 서평, 신간도서나 현재 베스트셀러를 찾을 때는 먼저 get_current_korean_time으로 현재 시간을 확인하세요)", inputSchema: SearchArgsSchema.shape, }, async (args) => { const result = await searchToolHandlers.search_book(args); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } );
- src/schemas/search.schemas.ts:33-41 (schema)Zod schema defining input parameters for the search_book tool (query, display, start, sort).export const SearchArgsSchema = z.object({ query: z.string().describe("검색어"), display: z.number().optional().describe("한 번에 가져올 결과 수 (기본 10)"), start: z.number().optional().describe("검색 시작 위치 (기본 1)"), sort: z .enum(["sim", "date"]) .optional() .describe("정렬 방식 (sim: 유사도, date: 날짜순)"), });
- Wrapper function in searchToolHandlers object that parses args with SearchArgsSchema and delegates to handleBookSearch.search_book: (args) => { console.error("search_book called with args:", JSON.stringify(args, null, 2)); return handleBookSearch(SearchArgsSchema.parse(args)); },