Skip to main content
Glama
ai-naming-standard

AI Naming Standard MCP Server

Official

generateFileName

Create standardized file names for microservices by combining components like microservice, layer, domain, and action according to AI naming conventions.

Instructions

Generates file names according to AI naming convention

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
microserviceYesMicroservice name (auth, user, payment, etc.)
sequenceNoSequence (001-999, v1-v99, main/alt) or relationship (001-1, 001a, 001s1)001
layerYesArchitecture layer
domainYesDomain-subdomain (user-login, payment-card, etc.)
actionYesCRUD operation
featureNoDetailed feature
envNoEnvironment
extYesFile extension

Implementation Reference

  • The core handler function that implements the generateFileName tool logic. It generates file names based on parameters like folder, index, layer, domain, feature, action, detail, env, and ext, handling special cases for static and test files.
    export async function generateFileName({
      folder = '03_ACTIVE',
      index = '001',
      layer = 'BE',
      domain,
      feature,
      action = 'R',
      detail = 'Service',
      env = 'DEV',
      ext = 'js',
      isTest = false,
      isStatic = false,
      staticType = null
    }) {
      const msg = getMessages();
      
      // 02_STATIC 파일 처리 (ChatGPT Enhancement)
      if (folder === '02_STATIC' || isStatic) {
        const prefix = staticType === 'template' ? 'TEMPLATE_' : 
                       staticType === 'config' ? 'CONFIG_' : 'ASSET_';
        const staticName = domain || 'file';
        return {
          fileName: `${prefix}${staticName}.${ext}`,
          folder: '02_STATIC',
          fullPath: `02_STATIC/${prefix}${staticName}.${ext}`,
          description: `Static ${staticType || 'asset'} file`,
          requiresPrefix: true
        };
      }
      
      // 04_TEST 파일 처리 (ChatGPT Enhancement)
      if (folder === '04_TEST' || isTest) {
        const testType = detail || 'Unit';
        const testFileName = `${index}_TEST_${domain}-${feature}_${testType}_${env}.test.${ext}`;
        return {
          fileName: testFileName,
          folder: '04_TEST',
          fullPath: `04_TEST/${testFileName}`,
          description: `Test file for ${domain}-${feature} (${testType})`,
          indexedNaming: true
        };
      }
      
      // 도메인과 기능 정규화 (03_ACTIVE 파일)
      const normalizedDomain = domain.charAt(0).toUpperCase() + domain.slice(1).toLowerCase();
      const normalizedFeature = feature.charAt(0).toUpperCase() + feature.slice(1).toLowerCase();
      
      // 표준 파일명 생성 (v5 패턴)
      const fileName = `${index}_${layer}_${normalizedDomain}-${normalizedFeature}_${action}_${detail}_${env}.${ext}`;
      
      return {
        fileName,
        folder,
        fullPath: `${folder}/${fileName}`,
        description: `${layer} ${normalizedDomain} ${normalizedFeature} ${detail} for ${env} environment`,
        hasDependency: index.includes('-') || index.includes('s') || /[a-z]$/.test(index)
      };
    }
  • src/index.js:64-111 (registration)
    Registers the generateFileName tool in the MCP server, including name, description from messages, and detailed inputSchema defining parameters and enums.
      name: 'generateFileName',
      description: msg.tools.generateFileName.description,
      inputSchema: {
        type: 'object',
        properties: {
          microservice: {
            type: 'string',
            description: msg.parameters.microservice,
            enum: ['auth', 'user', 'payment', 'order', 'product', 'notification', 'analytics', 'gateway', 'search', 'recommendation']
          },
          sequence: {
            type: 'string',
            description: msg.parameters.sequence,
            default: '001'
          },
          layer: {
            type: 'string',
            description: msg.parameters.layer,
            enum: ['controller', 'service', 'repository', 'model', 'dto', 'middleware', 'util', 'config', 'validator', 'helper']
          },
          domain: {
            type: 'string',
            description: msg.parameters.domain
          },
          action: {
            type: 'string',
            description: msg.parameters.action,
            enum: ['create', 'read', 'update', 'delete', 'validate', 'transform', 'calculate', 'send', 'fetch', 'process']
          },
          feature: {
            type: 'string',
            description: msg.parameters.feature,
            enum: ['validation', 'encryption', 'caching', 'logging', 'notification', 'export', 'import', 'batch', 'async', 'sync']
          },
          env: {
            type: 'string',
            description: msg.parameters.env,
            enum: ['dev', 'test', 'staging', 'prod', 'common']
          },
          ext: {
            type: 'string',
            description: msg.parameters.ext,
            enum: ['js', 'ts', 'py', 'java', 'go', 'yml', 'json', 'sql', 'md']
          }
        },
        required: ['microservice', 'layer', 'domain', 'action', 'ext']
      }
    },
  • The switch case in the MCP tool request handler that dispatches calls to the generateFileName function.
    case 'generateFileName':
      result = await generateFileName(args);
      break;
  • Input schema validation for the generateFileName tool, defining types, enums, and required parameters.
    inputSchema: {
      type: 'object',
      properties: {
        microservice: {
          type: 'string',
          description: msg.parameters.microservice,
          enum: ['auth', 'user', 'payment', 'order', 'product', 'notification', 'analytics', 'gateway', 'search', 'recommendation']
        },
        sequence: {
          type: 'string',
          description: msg.parameters.sequence,
          default: '001'
        },
        layer: {
          type: 'string',
          description: msg.parameters.layer,
          enum: ['controller', 'service', 'repository', 'model', 'dto', 'middleware', 'util', 'config', 'validator', 'helper']
        },
        domain: {
          type: 'string',
          description: msg.parameters.domain
        },
        action: {
          type: 'string',
          description: msg.parameters.action,
          enum: ['create', 'read', 'update', 'delete', 'validate', 'transform', 'calculate', 'send', 'fetch', 'process']
        },
        feature: {
          type: 'string',
          description: msg.parameters.feature,
          enum: ['validation', 'encryption', 'caching', 'logging', 'notification', 'export', 'import', 'batch', 'async', 'sync']
        },
        env: {
          type: 'string',
          description: msg.parameters.env,
          enum: ['dev', 'test', 'staging', 'prod', 'common']
        },
        ext: {
          type: 'string',
          description: msg.parameters.ext,
          enum: ['js', 'ts', 'py', 'java', 'go', 'yml', 'json', 'sql', 'md']
        }
      },
      required: ['microservice', 'layer', 'domain', 'action', 'ext']
    }
  • Imports for messages and naming rules used within the generateFileName handler.
    import { getMessages, formatMessage } from '../messages/index.js';
    import namingRules from '../rules/convention.js';
    
    // ========== v4 기존 도구들 (하위 호환성) ==========
    
    // 파일명 생성 함수 (v5.0.1 ChatGPT Enhancement)
    export async function generateFileName({
      folder = '03_ACTIVE',
      index = '001',
      layer = 'BE',
      domain,
      feature,
      action = 'R',
      detail = 'Service',
      env = 'DEV',
      ext = 'js',
      isTest = false,
      isStatic = false,
      staticType = null
    }) {
      const msg = getMessages();
      
      // 02_STATIC 파일 처리 (ChatGPT Enhancement)
      if (folder === '02_STATIC' || isStatic) {
        const prefix = staticType === 'template' ? 'TEMPLATE_' : 
                       staticType === 'config' ? 'CONFIG_' : 'ASSET_';
        const staticName = domain || 'file';
        return {
          fileName: `${prefix}${staticName}.${ext}`,
          folder: '02_STATIC',
          fullPath: `02_STATIC/${prefix}${staticName}.${ext}`,
          description: `Static ${staticType || 'asset'} file`,
          requiresPrefix: true
        };
      }
      
      // 04_TEST 파일 처리 (ChatGPT Enhancement)
      if (folder === '04_TEST' || isTest) {
        const testType = detail || 'Unit';
        const testFileName = `${index}_TEST_${domain}-${feature}_${testType}_${env}.test.${ext}`;
        return {
          fileName: testFileName,
          folder: '04_TEST',
          fullPath: `04_TEST/${testFileName}`,
          description: `Test file for ${domain}-${feature} (${testType})`,
          indexedNaming: true
        };
      }
      
      // 도메인과 기능 정규화 (03_ACTIVE 파일)
      const normalizedDomain = domain.charAt(0).toUpperCase() + domain.slice(1).toLowerCase();
      const normalizedFeature = feature.charAt(0).toUpperCase() + feature.slice(1).toLowerCase();
      
      // 표준 파일명 생성 (v5 패턴)
      const fileName = `${index}_${layer}_${normalizedDomain}-${normalizedFeature}_${action}_${detail}_${env}.${ext}`;
      
      return {
        fileName,
        folder,
        fullPath: `${folder}/${fileName}`,
        description: `${layer} ${normalizedDomain} ${normalizedFeature} ${detail} for ${env} environment`,
        hasDependency: index.includes('-') || index.includes('s') || /[a-z]$/.test(index)
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool generates file names but doesn't explain how the naming convention works, what format the output takes (e.g., string, structured data), or any constraints like rate limits or permissions. For a tool with 8 parameters and no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. However, it could be more structured by briefly hinting at parameter roles (e.g., 'combines microservice, layer, etc.') to add value, but it avoids waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain the output format, how parameters combine, or behavioral traits like idempotency or error handling. For a generation tool with rich input schema but no other structured data, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with detailed descriptions and enums for most parameters, so the schema does the heavy lifting. The description adds no additional parameter semantics beyond implying that parameters combine into an 'AI naming convention', but it doesn't explain how they interact or the resulting file name structure. Baseline 3 is appropriate given high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose ('Generates file names according to AI naming convention'), which is clear but vague. It specifies the verb ('Generates') and resource ('file names'), but doesn't distinguish it from sibling tools like 'naturalLanguageToFileName' or 'explainFileName'. The mention of 'AI naming convention' adds some specificity but remains broad.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'naturalLanguageToFileName' (which might convert natural language to file names) and 'explainFileName' (which might explain naming conventions), there's no indication of when this generation tool is preferred. No context or exclusions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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