Skip to main content
Glama
ethancod1ng

RedNote MCP Server

by ethancod1ng

rednote_get_user_info

Retrieve user profiles and information from Xiaohongshu (Little Red Book) by providing a user ID or username.

Instructions

获取用户信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes用户ID或用户名

Implementation Reference

  • The handler function for the 'rednote_get_user_info' tool. Validates input parameters, calls the RedNote API to fetch user information, formats the response as MCP content, and handles errors.
    async getUserInfo(params: any) {
      try {
        validateNotEmpty(params.user_id, 'user_id');
        validateString(params.user_id, 'user_id');
    
        logger.info('Executing get user info tool', { userId: params.user_id });
        
        const result = await this.api.getUserInfo(params.user_id);
        
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }]
        };
      } catch (error) {
        logger.error('Error in getUserInfo tool:', error);
        return {
          content: [{
            type: 'text',
            text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`
          }],
          isError: true
        };
      }
    }
  • src/server.ts:70-71 (registration)
    Registers the 'rednote_get_user_info' tool by mapping it to this.userTools.getUserInfo in the MCP server request handler switch statement.
    case 'rednote_get_user_info':
      return await this.userTools.getUserInfo(params);
  • Defines the tool schema including name, description, and input schema requiring 'user_id' parameter.
    rednote_get_user_info: {
      name: 'rednote_get_user_info',
      description: '获取用户信息',
      inputSchema: {
        type: 'object',
        properties: {
          user_id: {
            type: 'string',
            description: '用户ID或用户名'
          }
        },
        required: ['user_id']
      }
    },
  • src/server.ts:32-36 (registration)
    Instantiates the UserTools class instance used for handling user-related tools including getUserInfo.
      this.userTools = new UserTools();
      this.analysisTools = new AnalysisTools();
    
      this.setupHandlers();
    }
  • Core API method called by the tool handler to retrieve (mock) user information from RedNote.
    async getUserInfo(userId: string): Promise<RedNoteUser> {
      logger.info('Getting user info', { userId });
      
      try {
        const mockUser = this.generateMockUser(userId);
        return mockUser;
      } catch (error) {
        logger.error('Error getting user info:', error);
        throw new Error(`Failed to get user info for ${userId}: ${error}`);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but provides minimal information. '获取用户信息' implies a read operation but doesn't specify what kind of information is returned, whether authentication is required, if there are rate limits, or what format the response takes. For a tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just three Chinese characters ('获取用户信息'), which translates to 'Get user information'. There is zero wasted language or unnecessary elaboration. While this conciseness comes at the cost of detail, the description is perfectly front-loaded and every character serves its purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that this is a user information retrieval tool with no annotations, no output schema, and a minimal description, the contextual information is inadequate. The description doesn't explain what kind of user information is returned, how it differs from sibling tools, or what the response format looks like. For a tool that presumably returns structured user data, more context would be helpful for an AI agent to understand when and how to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'user_id' clearly documented as accepting either user ID or username. The description adds no additional parameter information beyond what the schema provides. According to scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '获取用户信息' (Get user information) is a tautology that essentially restates the tool name 'rednote_get_user_info'. It provides a generic verb+resource but lacks specificity about what type of user information is retrieved or how it differs from sibling tools like 'rednote_get_user_notes' which also deals with user data. The purpose is clear at a basic level but doesn't distinguish this tool from alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There are multiple sibling tools dealing with user data (rednote_get_user_notes) and note retrieval (rednote_get_note, rednote_search_notes), but the description offers no context about when this specific user information tool is appropriate versus those other options. No prerequisites, exclusions, or alternative suggestions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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