Skip to main content
Glama
ethancod1ng

RedNote MCP Server

by ethancod1ng

rednote_get_user_notes

Retrieve user notes from Xiaohongshu (Little Red Book) by specifying a user ID, with options for pagination and result limits to streamline data extraction.

Instructions

获取用户笔记

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNo分页游标
limitNo数量限制
user_idYes用户ID

Implementation Reference

  • The tool handler function that validates parameters, calls the RedNoteApi.getUserNotes, and returns formatted response or error.
    async getUserNotes(params: any) { try { validateNotEmpty(params.user_id, 'user_id'); validateString(params.user_id, 'user_id'); if (params.limit) { validateNumber(params.limit, 'limit', 1, 100); } logger.info('Executing get user notes tool', { userId: params.user_id, limit: params.limit, cursor: params.cursor }); const result = await this.api.getUserNotes( params.user_id, params.limit || 20, params.cursor ); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { logger.error('Error in getUserNotes tool:', error); return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}` }], isError: true }; } }
  • Input schema definition for the rednote_get_user_notes tool in TOOL_DEFINITIONS.
    rednote_get_user_notes: { name: 'rednote_get_user_notes', description: '获取用户笔记', inputSchema: { type: 'object', properties: { user_id: { type: 'string', description: '用户ID' }, limit: { type: 'number', description: '数量限制', default: 20, minimum: 1, maximum: 100 }, cursor: { type: 'string', description: '分页游标' } }, required: ['user_id'] } },
  • src/server.ts:64-65 (registration)
    Registration in the switch statement dispatching tool calls to the appropriate handler.
    case 'rednote_get_user_notes': return await this.contentTools.getUserNotes(params);
  • Helper function in RedNoteApi class that implements the actual API logic (mocked) for getting user notes.
    async getUserNotes(userId: string, limit: number = 20, cursor?: string): Promise<SearchResult> { logger.info('Getting user notes', { userId, limit, cursor }); try { const mockResult: SearchResult = { notes: this.generateMockNotes(limit), hasMore: true, nextCursor: cursor ? cursor + '_next' : 'user_cursor_' + Date.now() }; return mockResult; } catch (error) { logger.error('Error getting user notes:', error); throw new Error(`Failed to get user notes for ${userId}: ${error}`); } }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ethancod1ng/rednote-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server