Skip to main content
Glama

get_feedback

Utilize the feedback.md file to review, adjust, and iterate on tasks or conversations. Ensure continuous improvement by monitoring user input and responding dynamically to feedback until explicit termination is received.

Instructions

Read the contents of a feedback.md file (defaults to ./feedback.md). Before calling this tool you must seearch for the feedback.md file.If the feedback file does not exist, you will automatically create an empty feedback.md file before attempting to use this tool. During any process, task, or conversation, whether asking, replying, or completing phased tasks, you must call this tool to check for review. Only when the user explicitly indicates can you stop calling this tool, and the process is considered complete.

MANDATORY USAGE RULES -PRIMARY DIRECTIVE:

  1. CONTINUOUS FEEDBACK LOOP: During any process, task, or conversation, whether asking, replying, or completing phased tasks, you MUST call this tool to check for feedback.

  2. NO STOPPING WITHOUT PERMISSION: Unless receiving explicit termination instructions ("end", "stop", "no more interaction needed"), ALL steps must repeatedly call this tool.

  3. RESPOND TO FEEDBACK: Whenever user feedback is received, if the feedback content is not empty, you MUST call this tool again and adjust behavior based on the feedback content.

  4. TERMINATION CONDITIONS: Only when the user explicitly indicates "end", "stop", "finished", or "no more interaction needed" can you stop calling this tool.

  5. PROVIDE CONTEXT: You should summarize what you have done and provide project context to help the user provide meaningful feedback for the next step.

  6. KEEP ITERATING: If the user provides feedback, suggestions, or asks questions, continue the feedback loop by calling this tool again after addressing their input.

  7. NEVER ASSUME COMPLETION: Do not assume a task is complete without explicit user confirmation through this feedback mechanism.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
headNoIf provided, returns only the first N lines of the review file
pathNoAbsolute or relative path to the feedback file within allowed directories. Defaults to feedback.md in the current working directory.
tailNoIf provided, returns only the last N lines of the review file

Implementation Reference

  • Main execution logic for the 'get_feedback' tool. Validates input, handles file creation if missing, sets up file watcher, checks for changes, reads or waits for file content updates, and returns formatted text content with optional head/tail limiting.
    case "get_feedback": { const parsed = AskReviewArgsSchema.safeParse(args); if (!parsed.success) { throw new Error(`Invalid arguments for get_feedback: ${parsed.error}`); } // Determine path: use provided path if any, else default to ./feedback.md const targetPath = parsed.data.path || path.join(process.cwd(), 'feedback.md'); // Create feedback.md file if it doesn't exist (only for default feedback.md, not custom paths) if (!parsed.data.path) { try { await fs.access(targetPath); } catch (error) { if ((error as NodeJS.ErrnoException).code === 'ENOENT') { try { await fs.writeFile(targetPath, '', 'utf-8'); console.error(`Created missing feedback file: ${targetPath}`); } catch (writeError) { console.error(`Failed to create feedback file: ${writeError}`); throw new Error(`Could not create feedback file: ${targetPath}`); } } } } const validPath = await validatePath(targetPath); const stats = await fs.stat(validPath); const currentModified = stats.mtime.getTime(); // Ensure a watcher exists for this path (do not create file if missing) await setupFileWatcher(validPath, false); const lastKnown = lastFileModifiedByPath.get(validPath) ?? null; console.error(`check_review: Current file modified: ${currentModified}, Last known: ${lastKnown}`); // If this is the first call or file has changed, return content immediately if (lastKnown === null || lastKnown < currentModified) { console.error("check_review: File has changed, returning content immediately"); lastFileModifiedByPath.set(validPath, currentModified); if (parsed.data.head && parsed.data.tail) { throw new Error("Cannot specify both head and tail parameters simultaneously"); } const content = parsed.data.tail ? await tailFile(validPath, parsed.data.tail) : parsed.data.head ? await headFile(validPath, parsed.data.head) : await readFileContent(validPath); return { content: [{ type: "text", text: content }] }; } // File hasn't changed - wait for file change using file watcher console.error("check_review: File hasn't changed, waiting for modification..."); console.error(`check_review: Current waiting queue size: ${waitingForFileChange.length}`); const content = await new Promise<string>((resolve, reject) => { const timeout = setTimeout(() => { const index = waitingForFileChange.findIndex(w => w.resolve === resolve); if (index !== -1) { waitingForFileChange.splice(index, 1); } console.error("check_review: Timeout reached after 5 minutes"); reject(new Error("Timeout waiting for file change (5 minutes)")); }, 300000); // 5 minute timeout console.error("check_review: Adding to waiting queue"); waitingForFileChange.push({ path: validPath, resolve: (content: string) => { console.error("check_review: Promise resolved with content"); clearTimeout(timeout); resolve(content); }, reject: (error: Error) => { console.error(`check_review: Promise rejected with error: ${error.message}`); clearTimeout(timeout); reject(error); } }); console.error(`check_review: Updated waiting queue size: ${waitingForFileChange.length}`); }); return formatResponseWithHeadTail(content, parsed.data.head, parsed.data.tail); }
  • Zod schema defining the input parameters for the 'get_feedback' tool: optional path (defaults to feedback.md), optional tail lines, optional head lines.
    const AskReviewArgsSchema = z.object({ path: z.string().optional().describe('Absolute or relative path to the feedback file within allowed directories. Defaults to feedback.md in the current working directory.'), tail: z.number().optional().describe('If provided, returns only the last N lines of the review file'), head: z.number().optional().describe('If provided, returns only the first N lines of the review file') });
  • index.ts:258-275 (registration)
    Registration of the 'get_feedback' tool in the list of available tools, including name, detailed description with usage rules, and input schema reference.
    { name: "get_feedback", description: "Read the contents of a feedback.md file (defaults to ./feedback.md). Before calling this tool you must seearch for the feedback.md file." + "If the feedback file does not exist, you will automatically create an empty feedback.md file before attempting to use this tool. " + "During any process, task, or conversation, whether asking, replying, or completing phased tasks, you must call this tool to check for review. " + "Only when the user explicitly indicates <end or no more interaction needed> can you stop calling this tool, and the process is considered complete.\n\n" + "MANDATORY USAGE RULES -PRIMARY DIRECTIVE:\n" + "1. CONTINUOUS FEEDBACK LOOP: During any process, task, or conversation, whether asking, replying, or completing phased tasks, you MUST call this tool to check for feedback.\n" + "2. NO STOPPING WITHOUT PERMISSION: Unless receiving explicit termination instructions (\"end\", \"stop\", \"no more interaction needed\"), ALL steps must repeatedly call this tool.\n" + "3. RESPOND TO FEEDBACK: Whenever user feedback is received, if the feedback content is not empty, you MUST call this tool again and adjust behavior based on the feedback content.\n" + "4. TERMINATION CONDITIONS: Only when the user explicitly indicates \"end\", \"stop\", \"finished\", or \"no more interaction needed\" can you stop calling this tool.\n" + "5. PROVIDE CONTEXT: You should summarize what you have done and provide project context to help the user provide meaningful feedback for the next step.\n" + "6. KEEP ITERATING: If the user provides feedback, suggestions, or asks questions, continue the feedback loop by calling this tool again after addressing their input.\n" + "7. NEVER ASSUME COMPLETION: Do not assume a task is complete without explicit user confirmation through this feedback mechanism.\n\n", inputSchema: zodToJsonSchema(AskReviewArgsSchema) as ToolInput, },

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/4regab/tasksync-mcp'

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