get_feedback_analytics
Generate feedback analytics reports from project directories to analyze user interactions over specified time periods.
Instructions
获取反馈分析报告
Args:
project_directory: 项目目录
days: 分析天数
user_id: 用户ID
Returns:
分析报告
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_directory | Yes | ||
| days | No | ||
| user_id | No | default |
Implementation Reference
- server.py:378-408 (handler)The handler function implementing the 'get_feedback_analytics' MCP tool. It fetches feedback patterns from the analytics service for the given project and time period, formats them into a report, and handles errors. Registered as a tool using the @self.app.tool() decorator.
@self.app.tool() def get_feedback_analytics( project_directory: str, days: int = 30, user_id: str = "default" ) -> Dict[str, Any]: """ 获取反馈分析报告 Args: project_directory: 项目目录 days: 分析天数 user_id: 用户ID Returns: 分析报告 """ try: patterns = self.analytics.get_feedback_patterns(project_directory, days) return { "project": project_directory, "analysis_period_days": days, "patterns": patterns["patterns"], "suggestions": patterns["suggestions"], "generated_at": datetime.now().isoformat(), "status": "success" } except Exception as e: logger.error(f"Error in get_feedback_analytics: {e}") return {"error": str(e), "status": "error"}