Skip to main content
Glama

interactive_feedback

Request and receive interactive feedback for project directories and summaries by sharing context with AI assistants to refine and enhance 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. Validates the OpenAI API key, cleans input parameters, and delegates to launchFeedbackUI to collect user feedback via a web interface.
    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)
    Registers the 'interactive_feedback' tool in the MCPServer instance, specifying its description, input schema, and handler function.
    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 } };
  • Defines the input schema for the 'interactive_feedback' tool, specifying required parameters 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'] },
  • Helper function called by the handler to spawn the web-ui.js process, wait for its completion, read the feedback result from a temporary JSON file, and return it.
    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; } }
  • In the web UI server, constructs the result object with command_logs and interactive_feedback (user's feedback text), which is written to the output file and returned as the tool's result.
    command_logs: logs, interactive_feedback: feedback };

Other Tools

Related 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