get_file_approval_status
Check if a file has been approved for modification within the MCP Memory Server's safety workflow to prevent unauthorized changes.
Instructions
Get approval status for a file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to the file |
Implementation Reference
- src/index.ts:825-829 (handler)MCP tool handler for 'get_file_approval_status' that extracts the filePath argument, calls memoryManager.getFileApprovalStatus, and returns JSON-stringified result.case 'get_file_approval_status': { const filePath = args.filePath as string; const approval = await this.memoryManager.getFileApprovalStatus(filePath); return { content: [{ type: 'text', text: JSON.stringify(approval, null, 2) }] }; }
- src/index.ts:615-625 (registration)Registration of the 'get_file_approval_status' tool in the ListTools response, including input schema definition.{ name: 'get_file_approval_status', description: 'Get approval status for a file', inputSchema: { type: 'object', properties: { filePath: { type: 'string', description: 'Path to the file' } }, required: ['filePath'] } },
- src/memory-manager.ts:218-222 (helper)Core helper function implementing the logic to retrieve file approval status from project memory by relative path.async getFileApprovalStatus(filePath: string): Promise<ApprovalStatus | null> { const memory = await this.getProjectMemory(); const relativePath = path.relative(this.projectRoot, filePath); return memory.approvalStates[relativePath] || null; }
- src/types.ts:52-62 (schema)TypeScript interface defining the ApprovalStatus structure used as return type for the tool.export interface ApprovalStatus { devApproved?: boolean; devApprovedBy?: string; devApprovedDate?: string; codeReviewApproved?: boolean; codeReviewApprovedBy?: string; codeReviewDate?: string; qaApproved?: boolean; qaApprovedBy?: string; qaApprovedDate?: string; }