Skip to main content
Glama
rickcen01

Enhanced Interactive Feedback MCP Server

by rickcen01

interactive_feedback

Collect structured feedback on projects through interactive prompts, supporting questions, code reviews, suggestions, and error reports with priority levels and multi-language options.

Instructions

        增强型交互式反馈工具
        
        Args:
            project_directory: 项目目录路径
            message: 反馈消息或问题
            feedback_type: 反馈类型 (question/confirmation/selection/code_review/suggestion/error_report)
            priority: 优先级 (low/medium/high/urgent)
            options: 预设选项列表 (用于选择题)
            language: 语言设置 (en/zh)
            timeout: 超时时间(秒)
            tags: 标签列表
            user_id: 用户ID
        
        Returns:
            包含用户反馈和分析信息的字典
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_directoryYes
messageYes
feedback_typeNoquestion
priorityNomedium
optionsNo
languageNoen
timeoutNo
tagsNo
user_idNodefault

Implementation Reference

  • The core handler function for the 'interactive_feedback' tool. It collects user feedback through a console dialog, saves to analytics, generates suggestions, and returns structured response. Registered via @self.app.tool() decorator.
    def interactive_feedback(
        project_directory: str,
        message: str,
        feedback_type: str = "question",
        priority: str = "medium",
        options: Optional[List[str]] = None,
        language: str = "en",
        timeout: int = 300,
        tags: Optional[List[str]] = None,
        user_id: str = "default"
    ) -> Dict[str, Any]:
        """
        增强型交互式反馈工具
        
        Args:
            project_directory: 项目目录路径
            message: 反馈消息或问题
            feedback_type: 反馈类型 (question/confirmation/selection/code_review/suggestion/error_report)
            priority: 优先级 (low/medium/high/urgent)
            options: 预设选项列表 (用于选择题)
            language: 语言设置 (en/zh)
            timeout: 超时时间(秒)
            tags: 标签列表
            user_id: 用户ID
        
        Returns:
            包含用户反馈和分析信息的字典
        """
        try:
            # 验证参数
            feedback_type_enum = FeedbackType(feedback_type)
            priority_enum = Priority(priority)
            
            # 生成唯一ID
            feedback_id = str(uuid.uuid4())
            start_time = time.time()
            
            # 获取智能建议
            patterns = self.analytics.get_feedback_patterns(project_directory)
            
            # 格式化消息
            formatted_message = self._format_message(
                message, feedback_type_enum, language, options, patterns.get("suggestions", [])
            )
            
            # 显示反馈界面
            response = self._show_feedback_dialog(
                formatted_message, options, timeout, priority_enum, language
            )
            
            response_time = time.time() - start_time
            
            # 保存反馈记录
            feedback_record = FeedbackHistory(
                id=feedback_id,
                timestamp=datetime.now(),
                project_path=project_directory,
                feedback_type=feedback_type_enum,
                question=message,
                response=response,
                response_time=response_time,
                ai_summary="",  # 可以通过AI生成摘要
                tags=tags or [],
                priority=priority_enum,
                user_id=user_id
            )
            
            self.analytics.save_feedback(feedback_record)
            
            # 生成实时建议
            next_suggestions = self._generate_next_suggestions(
                project_directory, feedback_record
            )
            
            return {
                "feedback_id": feedback_id,
                "response": response,
                "response_time": response_time,
                "patterns": patterns,
                "next_suggestions": next_suggestions,
                "status": "success"
            }
            
        except Exception as e:
            logger.error(f"Error in interactive_feedback: {e}")
            return {
                "error": str(e),
                "status": "error"
            }
  • server.py:287-287 (registration)
    Registration of the interactive_feedback tool using FastMCP's @app.tool() decorator within the _register_tools method.
    @self.app.tool()
  • Input schema defined by function parameters with type hints and comprehensive docstring describing args and return type.
    def interactive_feedback(
        project_directory: str,
        message: str,
        feedback_type: str = "question",
        priority: str = "medium",
        options: Optional[List[str]] = None,
        language: str = "en",
        timeout: int = 300,
        tags: Optional[List[str]] = None,
        user_id: str = "default"
    ) -> Dict[str, Any]:
        """
        增强型交互式反馈工具
        
        Args:
            project_directory: 项目目录路径
            message: 反馈消息或问题
            feedback_type: 反馈类型 (question/confirmation/selection/code_review/suggestion/error_report)
            priority: 优先级 (low/medium/high/urgent)
            options: 预设选项列表 (用于选择题)
            language: 语言设置 (en/zh)
            timeout: 超时时间(秒)
            tags: 标签列表
            user_id: 用户ID
        
        Returns:
            包含用户反馈和分析信息的字典
        """
  • Key helper method that implements the console-based user interaction dialog for collecting feedback responses.
    def _show_feedback_dialog(
        self, 
        message: str, 
        options: Optional[List[str]], 
        timeout: int, 
        priority: Priority,
        language: str
    ) -> str:
        """显示反馈对话框(简化版,实际应该使用GUI)"""
        
        print("\n" + "="*60)
        print(f"🤖 Enhanced Interactive Feedback MCP")
        print(f"⏰ Timeout: {timeout}s | 🔥 Priority: {priority.value.upper()}")
        print("="*60)
        print(message)
        print("="*60)
        
        try:
            if options:
                while True:
                    response = input(f"\n{'Please enter your choice (number or text):' if language == 'en' else '请输入您的选择(数字或文本):'} ").strip()
                    
                    # 检查是否是数字选择
                    if response.isdigit():
                        idx = int(response) - 1
                        if 0 <= idx < len(options):
                            return options[idx]
                        else:
                            print(f"{'Invalid option number.' if language == 'en' else '无效的选项编号。'}")
                            continue
                    
                    # 检查是否是文本匹配
                    for option in options:
                        if response.lower() == option.lower():
                            return option
                    
                    # 如果都不匹配,返回原始输入
                    return response
            else:
                return input(f"\n{'Your response:' if language == 'en' else '您的回复:'} ").strip()
        
        except KeyboardInterrupt:
            return "cancelled" if language == "en" else "已取消"
        except Exception as e:
            logger.error(f"Error in dialog: {e}")
            return "error" if language == "en" else "错误"
  • Helper for formatting the feedback message with type labels, options, and AI suggestions in English or Chinese.
    def _format_message(
        self, 
        message: str, 
        feedback_type: FeedbackType, 
        language: str, 
        options: Optional[List[str]], 
        suggestions: List[str]
    ) -> str:
        """格式化反馈消息"""
        
        # 添加类型标识
        type_labels = {
            "en": {
                FeedbackType.QUESTION: "❓ Question",
                FeedbackType.CONFIRMATION: "✅ Confirmation", 
                FeedbackType.SELECTION: "📋 Selection",
                FeedbackType.CODE_REVIEW: "🔍 Code Review",
                FeedbackType.SUGGESTION: "💡 Suggestion",
                FeedbackType.ERROR_REPORT: "⚠️ Error Report"
            },
            "zh": {
                FeedbackType.QUESTION: "❓ 问题",
                FeedbackType.CONFIRMATION: "✅ 确认",
                FeedbackType.SELECTION: "📋 选择",
                FeedbackType.CODE_REVIEW: "🔍 代码审查", 
                FeedbackType.SUGGESTION: "💡 建议",
                FeedbackType.ERROR_REPORT: "⚠️ 错误报告"
            }
        }
        
        label = type_labels.get(language, type_labels["en"]).get(feedback_type, "")
        formatted = f"{label}\n\n{message}"
        
        # 添加选项
        if options:
            options_label = "Options:" if language == "en" else "选项:"
            formatted += f"\n\n{options_label}\n"
            for i, option in enumerate(options, 1):
                formatted += f"{i}. {option}\n"
        
        # 添加智能建议
        if suggestions:
            suggestions_label = "💡 AI Suggestions:" if language == "en" else "💡 AI建议:"
            formatted += f"\n\n{suggestions_label}\n"
            for suggestion in suggestions[:3]:  # 最多显示3个建议
                formatted += f"• {suggestion}\n"
        
        return formatted
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. It mentions 'enhanced interactive feedback' but doesn't explain what 'interactive' entails (e.g., user prompts, real-time responses, UI interactions). It lacks details on permissions, side effects, rate limits, or how feedback is processed, which is critical for a tool with many parameters and no output schema.

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

Conciseness3/5

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

The description is structured with a title and parameter list, but it's not front-loaded with a clear summary of the tool's function. The 'Args' section is detailed but could be more concise, and the overall text is moderately sized without unnecessary fluff, though it could be more efficient in conveying core functionality upfront.

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 the complexity (9 parameters, no annotations, no output schema), the description is incomplete. It lists parameters but doesn't explain the tool's behavior, return values, or how it interacts with users. For an 'interactive' tool with no structured output, more context on the feedback process and results is needed to be fully helpful.

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

Parameters4/5

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

The description includes an 'Args' section that lists all 9 parameters with brief explanations, adding significant meaning beyond the input schema which has 0% description coverage. It clarifies parameter purposes (e.g., feedback_type options, priority levels, options for multiple-choice), though some explanations remain basic (e.g., 'project_directory: project directory path'). This compensates well for the schema's lack of descriptions.

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

Purpose3/5

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

The description states the tool is an 'enhanced interactive feedback tool' which provides a general purpose, but it's vague about what 'interactive feedback' actually means in practice. It doesn't specify the action (e.g., 'collects', 'processes', 'initiates') or distinguish from sibling tools like create_feedback_template or get_feedback_analytics. The purpose is understandable but lacks specificity.

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?

No guidance is provided on when to use this tool versus alternatives like create_feedback_template, execute_with_feedback, or get_feedback_analytics. The description lists parameters but doesn't explain the context or scenarios for invoking this tool, leaving the agent without usage direction.

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/rickcen01/mcp'

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