Skip to main content
Glama
duolabmeng6

Interactive Feedback MCP

by duolabmeng6

interactive_feedback

Request interactive feedback on project changes by providing a directory path and summary, enabling collaborative review and improvement suggestions.

Instructions

Request interactive feedback for a given project directory and summary

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_directoryYesFull path to the project directory
summaryYesShort, one-line summary of the changes

Implementation Reference

  • The core handler function for the 'interactive_feedback' tool. Registered via @mcp.tool() decorator. Input schema defined via Annotated with Field descriptions. Launches UI subprocess and processes result.
    @mcp.tool()
    def interactive_feedback(
        project_directory: Annotated[str, Field(description="Full path to the project directory")],
        summary: Annotated[str, Field(description="Short, one-line summary of the changes")],
    ) -> Dict[str, str]:
        """Request interactive feedback for a given project directory and summary"""
        
        result_dict = launch_feedback_ui(first_line(project_directory), first_line(summary))
        return header_data(result_dict)
  • Helper function that launches the feedback_ui.py subprocess, passing project_directory and summary, captures JSON output.
    def launch_feedback_ui(project_directory: str, summary: str) -> dict[str, str]:
        # Create a temporary file for the feedback result
        with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as tmp:
            output_file = tmp.name
    
        try:
            # Get the path to feedback_ui.py relative to this script
            script_dir = os.path.dirname(os.path.abspath(__file__))
            feedback_ui_path = os.path.join(script_dir, "feedback_ui.py")
    
            # Run feedback_ui.py as a separate process
            args = [
                sys.executable,
                "-u",
                feedback_ui_path,
                "--project-directory", project_directory,
                "--prompt", summary,
                "--output-file", output_file
            ]
            result = subprocess.run(
                args,
                check=False,
                shell=False,
                stdout=subprocess.DEVNULL,
                stderr=subprocess.DEVNULL,
                stdin=subprocess.DEVNULL,
                close_fds=True
            )
            if result.returncode != 0:
                raise Exception(f"Failed to launch feedback UI: {result.returncode}")
    
            # Read the result from the temporary file
            with open(output_file, 'r') as f:
                result = json.load(f)
            os.unlink(output_file)
            return result
        except Exception as e:
            if os.path.exists(output_file):
                os.unlink(output_file)
            raise e
  • Helper function that processes the result from UI: extracts logs, feedback text, compresses and converts uploaded images to MCP Image objects, returns as tuple.
    def header_data(result_dict: dict) -> tuple:
        # print(result_dict)
        # {'logs': '', 'interactive_feedback': 'asdasdas', 'uploaded_images': ['/Users/ll/Desktop/2025/interactive-feedback-mcp/images/feedback.png']}
    
        logs = result_dict.get("logs", "")
        interactive_feedbacktxt = result_dict.get("interactive_feedback", "")
        uploaded_images = result_dict.get("uploaded_images", [])
    
        processed_content: List[Union[str, Image]] = []
    
        if logs and logs != "":
            processed_content.append("收集的日志: \n" + logs)
        
        if interactive_feedbacktxt and interactive_feedbacktxt != "":
            processed_content.append("用户反馈信息: \n" + interactive_feedbacktxt)
        
        for image_path in uploaded_images:
            image_data,img_format = compress_image(image_path)
            mcp_image = Image(data=image_data, format=img_format)
            processed_content.append(mcp_image)
            
        return tuple(processed_content)
  • Helper for compressing images if >800KB, thumbnails if needed, returns image data and format.
    def compress_image(image_path: str):
        pil_img = PILImage.open(image_path)
        img_format = (pil_img.format or "PNG").lower()
        temp_image_path = image_path + ".temp.jpg"
        if os.path.getsize(image_path) > 800 * 1024:
            img_format = (pil_img.format or "jpg").lower()
    
            pil_img.save(temp_image_path, optimize=True, quality=50)
            # 输出现在的尺寸
            # print(f"压缩前大小: {friendly_size(os.path.getsize(image_path))}")
            # print(f"压缩后大小: {friendly_size(os.path.getsize(temp_image_path))}")
            if os.path.getsize(temp_image_path) > 800 * 1024:
                pil_img.thumbnail((512, 512))
                pil_img.save(temp_image_path, optimize=True, quality=50)
                # print(f"缩放后大小: {friendly_size(os.path.getsize(temp_image_path))}")
                # print(f"缩放后大小: {friendly_size(os.path.getsize(temp_image_path))}")
            with open(temp_image_path, "rb") as f:
                image_data = f.read()
            os.unlink(temp_image_path)
            return image_data,img_format
        else:
            with open(image_path, "rb") as f:
                image_data = f.read()
            return image_data, img_format
  • FastMCP server instance creation, required for tool registration via decorators.
    mcp = FastMCP("Interactive Feedback MCP", log_level="ERROR")
Behavior2/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. It mentions 'interactive feedback' but doesn't explain what that entails—e.g., whether it initiates a user prompt, sends a notification, modifies files, or has side effects like authentication needs or rate limits. This leaves the agent with insufficient information about how the tool behaves.

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 a single, efficient sentence with no wasted words, clearly front-loading the purpose. It's appropriately sized for a tool with two parameters and no complex context.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'interactive feedback' means in practice, what the tool returns, or any behavioral traits. For a tool that likely involves user interaction or system changes, this leaves significant gaps in understanding.

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%, so the schema already documents both parameters fully. The description adds no additional meaning beyond what the schema provides, such as explaining how the parameters interact or their significance in the feedback process. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('Request interactive feedback') and the target resources ('for a given project directory and summary'), making the purpose understandable. It doesn't distinguish from siblings since there are none, but it's specific enough about what it does without being tautological.

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, prerequisites, or context for invocation. It simply states what it does without indicating scenarios or constraints for its application.

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/duolabmeng6/interactive-feedback-mcp'

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