Skip to main content
Glama
ethancod1ng

RedNote MCP Server

by ethancod1ng

rednote_get_note

Retrieve detailed note information from Xiaohongshu (Little Red Book) by specifying a note ID. Optionally include comments for comprehensive insights.

Instructions

获取笔记详情

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_commentsNo是否包含评论
note_idYes笔记ID

Implementation Reference

  • The main handler function that executes the rednote_get_note tool logic: validates parameters, calls the RedNote API, formats the response as JSON, and handles errors.
    async getNote(params: any) { try { validateNotEmpty(params.note_id, 'note_id'); validateString(params.note_id, 'note_id'); logger.info('Executing get note tool', { noteId: params.note_id }); const result = await this.api.getNote(params.note_id, params.include_comments || false); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { logger.error('Error in getNote tool:', error); return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}` }], isError: true }; } }
  • The input schema and metadata definition for the rednote_get_note tool, used for tool listing and validation.
    rednote_get_note: { name: 'rednote_get_note', description: '获取笔记详情', inputSchema: { type: 'object', properties: { note_id: { type: 'string', description: '笔记ID' }, include_comments: { type: 'boolean', description: '是否包含评论', default: false } }, required: ['note_id'] } },
  • src/server.ts:61-62 (registration)
    The switch case in the CallToolRequest handler that registers and dispatches calls to the rednote_get_note tool handler.
    case 'rednote_get_note': return await this.contentTools.getNote(params);
  • The API helper method called by the handler to fetch note details (mock implementation).
    async getNote(noteId: string, includeComments: boolean = false): Promise<RedNoteNote> { logger.info('Getting note', { noteId, includeComments }); try { const mockNote = this.generateMockNote(noteId); return mockNote; } catch (error) { logger.error('Error getting note:', error); throw new Error(`Failed to get note ${noteId}: ${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