rednote_search_notes
Search Xiaohongshu (Little Red Book) notes, videos, or all content types by keyword, with options to sort results by relevance, popularity, or recency, and set a limit on returned items.
Instructions
搜索小红书笔记
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | 搜索关键词 | |
| limit | No | 返回数量限制 | |
| sort | No | 排序方式 | relevant |
| type | No | 内容类型 | all |
Implementation Reference
- src/tools/search.ts:12-43 (handler)The primary handler function for the 'rednote_search_notes' MCP tool. It validates input parameters, prepares search params, calls the RedNote API, and returns the result as JSON text content or an error.async searchNotes(params: any) { try { validateSearchParams(params); const searchParams = { keyword: params.keyword, type: params.type || 'all', sort: params.sort || 'relevant', limit: params.limit || 20 }; logger.info('Executing search notes tool', { params: searchParams }); const result = await this.api.searchNotes(searchParams); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { logger.error('Error in searchNotes tool:', error); return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}` }], isError: true }; } }
- src/types/mcp.ts:16-48 (schema)The input schema definition for the 'rednote_search_notes' tool, including properties, types, descriptions, defaults, and required fields.rednote_search_notes: { name: 'rednote_search_notes', description: '搜索小红书笔记', inputSchema: { type: 'object', properties: { keyword: { type: 'string', description: '搜索关键词' }, type: { type: 'string', enum: ['note', 'video', 'all'], description: '内容类型', default: 'all' }, sort: { type: 'string', enum: ['latest', 'popular', 'relevant'], description: '排序方式', default: 'relevant' }, limit: { type: 'number', description: '返回数量限制', default: 20, minimum: 1, maximum: 100 } }, required: ['keyword'] } },
- src/server.ts:58-59 (registration)The switch case registration in the MCP server request handler that routes calls to the 'rednote_search_notes' tool to the SearchTools.searchNotes method.case 'rednote_search_notes': return await this.searchTools.searchNotes(params);