Skip to main content
Glama
ethancod1ng

RedNote MCP Server

by ethancod1ng

rednote_analyze_content

Analyze content text to identify sentiment, extract keywords, and categorize information using multiple analysis types.

Instructions

分析内容

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes内容文本
analysis_typeNo分析类型all

Implementation Reference

  • The primary handler function for the 'rednote_analyze_content' tool. It validates input parameters and calls the RedNoteApi to perform the content analysis, then formats the response.
    async analyzeContent(params: any) {
      try {
        validateNotEmpty(params.content, 'content');
        validateString(params.content, 'content');
        
        if (params.analysis_type) {
          validateEnum(params.analysis_type, 'analysis_type', ['sentiment', 'keywords', 'category', 'all']);
        }
    
        logger.info('Executing analyze content tool', { 
          contentLength: params.content.length,
          analysisType: params.analysis_type 
        });
        
        const result = await this.api.analyzeContent(params.content, params.analysis_type || 'all');
        
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }]
        };
      } catch (error) {
        logger.error('Error in analyzeContent tool:', error);
        return {
          content: [{
            type: 'text',
            text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`
          }],
          isError: true
        };
      }
    }
  • The input schema definition for the 'rednote_analyze_content' tool, including properties for content and analysis_type.
    rednote_analyze_content: {
      name: 'rednote_analyze_content',
      description: '分析内容',
      inputSchema: {
        type: 'object',
        properties: {
          content: {
            type: 'string',
            description: '内容文本'
          },
          analysis_type: {
            type: 'string',
            enum: ['sentiment', 'keywords', 'category', 'all'],
            description: '分析类型',
            default: 'all'
          }
        },
        required: ['content']
      }
    }
  • src/server.ts:73-74 (registration)
    Switch case in the tool request handler that registers and dispatches calls to the 'rednote_analyze_content' tool handler.
    case 'rednote_analyze_content':
      return await this.analysisTools.analyzeContent(params);
  • Core implementation of content analysis logic, generating mock results for sentiment, keywords, and category based on the specified analysis_type.
    async analyzeContent(content: string, analysisType: string = 'all'): Promise<AnalysisResult> {
      logger.info('Analyzing content', { contentLength: content.length, analysisType });
      
      try {
        const result: AnalysisResult = {};
        
        if (analysisType === 'sentiment' || analysisType === 'all') {
          result.sentiment = {
            score: Math.random() * 2 - 1,
            label: Math.random() > 0.5 ? 'positive' : 'negative',
            confidence: Math.random()
          };
        }
        
        if (analysisType === 'keywords' || analysisType === 'all') {
          result.keywords = this.extractKeywords();
        }
        
        if (analysisType === 'category' || analysisType === 'all') {
          result.category = this.predictCategory();
        }
        
        return result;
      } catch (error) {
        logger.error('Error analyzing content:', error);
        throw new Error(`Failed to analyze content: ${error}`);
      }
    }
  • Helper functions used by analyzeContent for extracting keywords and predicting category in a mock manner.
    private extractKeywords(): string[] {
      const commonWords = ['美食', '分享', '推荐', '好吃', '简单', '健康', '生活', '时尚', '美丽'];
      return commonWords.filter(() => Math.random() > 0.5).slice(0, 5);
    }
    
    private predictCategory(): string {
      const categories = ['美食', '时尚', '旅行', '生活', '美妆', '健身'];
      return categories[Math.floor(Math.random() * categories.length)];
    }
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description '分析内容' gives no indication of whether this is a read-only operation, if it has side effects, what permissions might be required, rate limits, or what the output format might be. For an analysis tool with zero annotation coverage, this is completely inadequate.

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

Conciseness2/5

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

While technically concise with just two characters, this represents under-specification rather than effective conciseness. The description fails to provide any meaningful information that would help an AI agent understand or use the tool correctly. Every sentence should earn its place, and this description doesn't earn its place at all.

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

Completeness1/5

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

Given the tool has 2 parameters, no annotations, and no output schema, the description '分析内容' is completely inadequate. It doesn't explain what analysis is performed, what the output looks like, when to use it, or any behavioral characteristics. For an analysis tool with this level of complexity and no structured support, the description fails to provide necessary context.

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?

Schema description coverage is 100%, with both parameters ('content' and 'analysis_type') having descriptions in the schema. The tool description adds no additional meaning about parameters beyond what's already documented in the schema. According to the rules, when schema coverage is high (>80%), the baseline score 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 '分析内容' (analyze content) is a tautology that essentially restates the tool name 'rednote_analyze_content' in Chinese. It doesn't specify what kind of analysis is performed, what resources are involved, or how it differs from sibling tools like 'rednote_search_notes' or 'rednote_get_trending_topics'. The purpose remains vague without additional context.

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

Usage Guidelines1/5

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

There is absolutely no guidance on when to use this tool versus alternatives. The description provides no context about appropriate use cases, prerequisites, or distinctions from sibling tools that also deal with content (like search_notes or get_trending_topics). This leaves the agent with no directional information.

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