Skip to main content
Glama
zivhdinfo

Interactive Feedback MCP

by zivhdinfo

interactive_feedback

Request interactive feedback on project code and context to enable human-in-the-loop AI development workflows.

Instructions

Request interactive feedback for a given project directory and summary

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_directoryYesPath to the project directory
summaryYesSummary of the request or context

Implementation Reference

  • The primary handler function for the 'interactive_feedback' MCP tool. It validates the OpenAI API key, cleans the input parameters (project directory and summary), and invokes launchFeedbackUI to spawn the web UI process and retrieve user feedback.
    async function interactiveFeedback(projectDirectory, summary) {
        // Validate OPENAI_API_KEY before proceeding
        if (!process.env.OPENAI_API_KEY) {
            const error = new Error('OpenAI API key not configured. Please set OPENAI_API_KEY in your .env file.');
            console.error('❌ API Key Validation Failed:', error.message);
            console.error('   Expected .env path:', path.join(__dirname, '.env'));
            console.error('   Current working directory:', process.cwd());
            console.error('   Script directory (__dirname):', __dirname);
            throw error;
        }
        
        // Validate API key format
        const apiKey = process.env.OPENAI_API_KEY;
        if (!apiKey.startsWith('sk-') || apiKey.length < 20) {
            const error = new Error('Invalid OpenAI API key format. Key should start with "sk-" and be at least 20 characters long.');
            console.error('❌ API Key Format Validation Failed:', error.message);
            console.error('   Key length:', apiKey.length);
            console.error('   Key prefix:', apiKey.substring(0, 3));
            throw error;
        }
        
        console.log('✅ API Key validation passed for interactive feedback');
        
        // Apply firstLine only to projectDirectory to ensure it's a valid path
        // Keep summary intact to preserve multi-line content
        const cleanProjectDirectory = firstLine(projectDirectory);
        const cleanSummary = summary || 'I implemented the changes you requested.';
        
        return await launchFeedbackUI(cleanProjectDirectory, cleanSummary);
    }
  • server.js:157-176 (registration)
    Tool registration in MCPServer constructor, defining the 'interactive_feedback' tool with its description, input schema, and handler reference.
    this.tools = {
        interactive_feedback: {
            description: 'Request interactive feedback for a given project directory and summary',
            inputSchema: {
                type: 'object',
                properties: {
                    project_directory: {
                        type: 'string',
                        description: 'Path to the project directory'
                    },
                    summary: {
                        type: 'string',
                        description: 'Summary of the request or context'
                    }
                },
                required: ['project_directory', 'summary']
            },
            handler: interactiveFeedback
        }
    };
  • Input schema for the 'interactive_feedback' tool, specifying required parameters: project_directory (string) and summary (string).
    inputSchema: {
        type: 'object',
        properties: {
            project_directory: {
                type: 'string',
                description: 'Path to the project directory'
            },
            summary: {
                type: 'string',
                description: 'Summary of the request or context'
            }
        },
        required: ['project_directory', 'summary']
    },
  • Key helper function called by the handler. Spawns the web-ui.js process with project directory, prompt/summary, and output file arguments. Waits for completion, reads JSON result from temp file, cleans up, and returns the feedback object containing command_logs and interactive_feedback.
    async function launchFeedbackUI(projectDirectory, summary) {
        // Create temporary file for result
        const tempDir = os.tmpdir();
        const uuid = crypto.randomUUID();
        const outputFile = path.join(tempDir, `feedback-${uuid}.json`);
        
        try {
            // Get path to web-ui.js
            const scriptDir = __dirname;
            const webUIPath = path.join(scriptDir, 'web-ui.js');
            
            // Prepare arguments for web UI process
            const args = [
                webUIPath,
                '--project-directory', projectDirectory,
                '--prompt', summary,
                '--output-file', outputFile
            ];
            
            // Spawn Web UI process
            const childProcess = spawn('node', args, {
                stdio: ['ignore', 'ignore', 'ignore'],
                detached: false
            });
            
            // Wait for process completion
            await new Promise((resolve, reject) => {
                childProcess.on('close', (code) => {
                    if (code === 0) {
                        resolve();
                    } else {
                        reject(new Error(`Web UI process exited with code ${code}`));
                    }
                });
                
                childProcess.on('error', (error) => {
                    reject(error);
                });
            });
            
            // Read result from temp file
            const result = await fs.readJson(outputFile);
            
            // Cleanup temp file
            await fs.unlink(outputFile);
            
            return result;
            
        } catch (error) {
            // Cleanup temp file if error occurs
            try {
                await fs.unlink(outputFile);
            } catch (cleanupError) {
                // Ignore cleanup errors
            }
            throw 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. It mentions 'interactive feedback' but doesn't explain what that means—whether it's a chat, UI prompt, or other interaction, nor does it cover permissions, side effects, or response format. This leaves critical behavioral traits unspecified.

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

Conciseness4/5

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

The description is concise and front-loaded, consisting of a single sentence that directly states the tool's purpose. It avoids unnecessary words, though it could be more informative without sacrificing brevity.

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' entails, how it's delivered, or what the agent should expect in return, making it insufficient for a tool with behavioral ambiguity.

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 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 examples or constraints, resulting in a baseline score of 3.

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's purpose with a specific verb ('Request') and resource ('interactive feedback'), but it's vague about what 'interactive feedback' entails. It doesn't differentiate from siblings, but since there are none, this isn't a major issue. However, the purpose remains somewhat ambiguous.

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, such as specific scenarios, prerequisites, or alternatives. It merely restates the parameters without context, leaving the agent with no usage instructions.

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

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