Skip to main content
Glama
ai-naming-standard

AI Naming Standard MCP Server

Official

validateFileName

Check if a file name follows AI naming conventions for microservices, including components like service, layer, domain, and action identifiers.

Instructions

Validates if a file name complies with AI naming convention

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNameYesFile name to validate

Implementation Reference

  • The main handler function that executes the validateFileName tool logic. It checks the fileName against a regex pattern for v5 naming convention and validates components like layer, action, env against allowed values.
    export async function validateFileName({ fileName, folder = '03_ACTIVE' }) { const msg = getMessages(); const rules = namingRules(); // v5 파일명 패턴 const pattern = /^([0-9]{3}(?:\.[0-9]+)?(?:[a-z]|s[0-9]+|-[0-9]+)?)_([A-Z]{2,6})_([A-Z][a-z]+(?:-[A-Z][a-z]+)+)_([CRUDVXSTG])_([A-Z][a-z]+)_([A-Z]{2,6})\.([a-z]+)$/; const match = fileName.match(pattern); if (!match) { return { valid: false, errors: [ msg.errors.invalidPattern || 'Invalid file name pattern', 'Correct format: [Index]_[Layer]_[Domain]-[Feature]_[Action]_[Detail]_[Env].[ext]' ], suggestion: await suggestCorrection({ fileName }) }; } const [, index, layer, domainFeature, action, detail, env, ext] = match; const errors = []; const warnings = []; // 폴더별 네이밍 규칙 체크 const folderRule = rules.standardFolders[folder]; if (folderRule && !folderRule.namingRuleRequired && folder !== '03_ACTIVE') { warnings.push(`Naming convention is optional for ${folder}`); } // Layer 검증 const validLayers = ['FE', 'BE', 'DB', 'API', 'ML', 'INFRA', 'SH']; if (!validLayers.includes(layer)) { errors.push(`Invalid layer: '${layer}'`); } // Action 검증 const validActions = ['C', 'R', 'U', 'D', 'V', 'X', 'S', 'T', 'G']; if (!validActions.includes(action)) { errors.push(`Invalid action: '${action}'`); } // Environment 검증 const validEnvs = ['DEV', 'STG', 'PROD', 'COMMON']; if (!validEnvs.includes(env)) { errors.push(`Invalid environment: '${env}'`); } return { valid: errors.length === 0, errors, warnings, components: { index, layer, domainFeature, action, detail, env, ext }, folder }; }
  • src/index.js:113-125 (registration)
    Registration of the validateFileName tool in the MCP server's tools list, including name, dynamic description, and input schema.
    name: 'validateFileName', description: msg.tools.validateFileName.description, inputSchema: { type: 'object', properties: { fileName: { type: 'string', description: msg.parameters.fileName } }, required: ['fileName'] } },
  • src/index.js:601-603 (registration)
    Dispatch handler in the MCP request handler that calls the validateFileName function when the tool is invoked.
    case 'validateFileName': result = await validateFileName(args); break;
  • Input schema definition for the validateFileName tool, specifying required 'fileName' parameter.
    inputSchema: { type: 'object', properties: { fileName: { type: 'string', description: msg.parameters.fileName } }, required: ['fileName'] }

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/ai-naming-standard/mcp'

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