checkFolderPermission
Verify AI access permissions for specific folders in microservices architecture to ensure compliance with naming standards and security protocols.
Instructions
Check AI permission for a specific folder (v6 includes 07_META)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | Yes | Folder name to check | |
| operation | No | Operation type | modify |
| aiName | No | AI name (cursor, claude, chatgpt, windsurf, human) | cursor |
Implementation Reference
- src/tools/index.js:592-628 (handler)The core handler function implementing the checkFolderPermission tool logic, using namingRules and hardcoded permissions to determine if an operation is allowed on a folder.export async function checkFolderPermission({ folder, operation = 'modify' }) { const msg = getMessages(); const rules = namingRules(); const folderInfo = rules.standardFolders[folder]; if (!folderInfo) { return { valid: false, error: `Unknown folder: ${folder}`, suggestion: 'Use one of: 00_DOCS, 01_CONFIG, 02_STATIC, 03_ACTIVE, 04_TEST, 05_BUILD, 06_LOGS' }; } const permissions = { '00_DOCS': { read: true, write: false, modify: false, delete: false }, '01_CONFIG': { read: true, write: false, modify: false, delete: false }, '02_STATIC': { read: true, write: true, modify: false, delete: false }, '03_ACTIVE': { read: true, write: true, modify: true, delete: true }, '04_TEST': { read: true, write: true, modify: true, delete: false }, '05_BUILD': { read: true, write: true, modify: false, delete: true }, '06_LOGS': { read: true, write: true, modify: false, delete: false } }; const permission = permissions[folder][operation]; return { folder, operation, allowed: permission, aiPermission: folderInfo.aiPermission, description: folderInfo.description, message: permission ? `AI can ${operation} in ${folder}` : `AI cannot ${operation} in ${folder} (${folderInfo.aiPermission})` }; }
- src/index.js:254-279 (schema)The input schema and metadata for the checkFolderPermission tool, defining parameters folder, operation, and aiName with enums and defaults.name: 'checkFolderPermission', description: 'Check AI permission for a specific folder (v6 includes 07_META)', inputSchema: { type: 'object', properties: { folder: { type: 'string', description: 'Folder name to check', enum: ['00_DOCS', '01_CONFIG', '02_STATIC', '03_ACTIVE', '04_TEST', '05_BUILD', '06_LOGS', '07_META'] }, operation: { type: 'string', description: 'Operation type', enum: ['read', 'write', 'modify', 'delete'], default: 'modify' }, aiName: { type: 'string', description: 'AI name (cursor, claude, chatgpt, windsurf, human)', enum: ['cursor', 'claude', 'chatgpt', 'windsurf', 'human'], default: 'cursor' } }, required: ['folder'] } },
- src/index.js:627-628 (registration)Registration in the main tool dispatcher switch statement that routes calls to the checkFolderPermission handler.case 'checkFolderPermission': result = await checkFolderPermission(args);