set_file_approval
Assign approval status to specified files using designated approval types and approver details. Facilitates tracking and managing file workflows within MCP Memory Server for secure coding session oversight.
Instructions
Set approval status for a file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| approvalType | Yes | ||
| approvedBy | Yes | Who approved it | |
| filePath | Yes | Path to the file |
Implementation Reference
- src/index.ts:602-614 (registration)Tool registration in the ListTools response, defining the tool name, description, and input schema.{ name: 'set_file_approval', description: 'Set approval status for a file', inputSchema: { type: 'object', properties: { filePath: { type: 'string', description: 'Path to the file' }, approvalType: { type: 'string', enum: ['devApproved', 'codeReviewApproved', 'qaApproved'] }, approvedBy: { type: 'string', description: 'Who approved it' } }, required: ['filePath', 'approvalType', 'approvedBy'] } },
- src/index.ts:817-822 (handler)MCP CallToolRequest handler case that parses arguments and delegates to MemoryManager.setFileApproval.case 'set_file_approval': { const filePath = args.filePath as string; const approvalType = args.approvalType as keyof import('./types').ApprovalStatus; const approvedBy = args.approvedBy as string; await this.memoryManager.setFileApproval(filePath, approvalType, approvedBy); return { content: [{ type: 'text', text: 'File approval set successfully' }] };
- src/memory-manager.ts:184-216 (handler)Core implementation of setFileApproval: updates the approval status for a file in the project memory's approvalStates.async setFileApproval(filePath: string, approvalType: keyof ApprovalStatus, approvedBy: string): Promise<void> { const memory = await this.getProjectMemory(); const relativePath = path.relative(this.projectRoot, filePath); if (!memory.approvalStates[relativePath]) { memory.approvalStates[relativePath] = {}; } const approvals = memory.approvalStates[relativePath]; // Set the approval status switch (approvalType) { case 'devApproved': approvals.devApproved = true; approvals.devApprovedBy = approvedBy; approvals.devApprovedDate = new Date().toISOString(); break; case 'codeReviewApproved': approvals.codeReviewApproved = true; approvals.codeReviewApprovedBy = approvedBy; approvals.codeReviewDate = new Date().toISOString(); break; case 'qaApproved': approvals.qaApproved = true; approvals.qaApprovedBy = approvedBy; approvals.qaApprovedDate = new Date().toISOString(); break; } await this.saveProjectMemory(memory); console.log(chalk.green(`✅ ${approvalType} set for ${relativePath} by ${approvedBy}`)); }