Skip to main content
Glama
ai-naming-standard

AI Naming Standard MCP Server

Official

suggestFolder

Analyzes file names and content to recommend appropriate folders based on AI-driven naming conventions for microservices architecture.

Instructions

Suggest appropriate folder for a file (v6 includes 07_META)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNameYesFile name to analyze
fileTypeNoType of file (optional)
contentNoFile content preview (optional)

Implementation Reference

  • The primary handler function that implements the suggestFolder tool logic. It analyzes the provided fileName, fileType, and content to determine the most appropriate standard folder based on naming conventions, extensions, and file type mappings.
    export async function suggestFolder({ 
      fileName, 
      fileType,
      content 
    }) {
      const msg = getMessages();
      const rules = namingRules();
      
      // 파일 유형별 폴더 매핑
      const typeMapping = {
        'documentation': '00_DOCS',
        'readme': '00_DOCS',
        'guide': '00_DOCS',
        'config': '01_CONFIG',
        'env': '01_CONFIG',
        'secret': '01_CONFIG',
        'image': '02_STATIC',
        'font': '02_STATIC',
        'template': '02_STATIC',
        'css': '02_STATIC',
        'code': '03_ACTIVE',
        'component': '03_ACTIVE',
        'service': '03_ACTIVE',
        'api': '03_ACTIVE',
        'test': '04_TEST',
        'spec': '04_TEST',
        'e2e': '04_TEST',
        'build': '05_BUILD',
        'dist': '05_BUILD',
        'bundle': '05_BUILD',
        'log': '06_LOGS',
        'error': '06_LOGS',
        'audit': '06_LOGS'
      };
      
      // 확장자별 폴더 매핑
      const extensionMapping = {
        'md': '00_DOCS',
        'txt': '00_DOCS',
        'yml': '01_CONFIG',
        'yaml': '01_CONFIG',
        'env': '01_CONFIG',
        'png': '02_STATIC',
        'jpg': '02_STATIC',
        'svg': '02_STATIC',
        'js': '03_ACTIVE',
        'jsx': '03_ACTIVE',
        'ts': '03_ACTIVE',
        'tsx': '03_ACTIVE',
        'py': '03_ACTIVE',
        'java': '03_ACTIVE',
        'test.js': '04_TEST',
        'spec.js': '04_TEST',
        'min.js': '05_BUILD',
        'bundle.js': '05_BUILD',
        'log': '06_LOGS'
      };
      
      let suggestedFolder = '03_ACTIVE'; // 기본값
      let reason = 'Default for active code';
      
      // 파일명 분석
      if (fileName) {
        const ext = fileName.split('.').pop().toLowerCase();
        
        // v5 네이밍 패턴 체크
        if (/^[0-9]{3}_[A-Z]{2,6}_/.test(fileName)) {
          suggestedFolder = '03_ACTIVE';
          reason = 'Follows v5 naming convention';
        } else if (extensionMapping[ext]) {
          suggestedFolder = extensionMapping[ext];
          reason = `Based on extension: .${ext}`;
        } else if (fileName.includes('test') || fileName.includes('spec')) {
          suggestedFolder = '04_TEST';
          reason = 'Test file detected';
        } else if (fileName.includes('config') || fileName.includes('settings')) {
          suggestedFolder = '01_CONFIG';
          reason = 'Configuration file detected';
        }
      }
      
      // 파일 타입으로 결정
      if (fileType && typeMapping[fileType.toLowerCase()]) {
        suggestedFolder = typeMapping[fileType.toLowerCase()];
        reason = `Based on file type: ${fileType}`;
      }
      
      const folderInfo = rules.standardFolders[suggestedFolder];
      
      return {
        fileName,
        suggestedFolder,
        reason,
        folderInfo: {
          name: folderInfo.name,
          description: folderInfo.description,
          aiPermission: folderInfo.aiPermission,
          namingRuleRequired: folderInfo.namingRuleRequired
        },
        alternativeFolders: Object.keys(rules.standardFolders).filter(f => f !== suggestedFolder),
        message: msg.v5?.folderSuggested || `Suggested folder: ${suggestedFolder} - ${reason}`
      };
    }
  • src/index.js:305-326 (registration)
    Tool registration in the MCP server's TOOLS list, defining the name, description, and input schema for suggestFolder.
    {
      name: 'suggestFolder',
      description: 'Suggest appropriate folder for a file (v6 includes 07_META)',
      inputSchema: {
        type: 'object',
        properties: {
          fileName: {
            type: 'string',
            description: 'File name to analyze'
          },
          fileType: {
            type: 'string',
            description: 'Type of file (optional)'
          },
          content: {
            type: 'string',
            description: 'File content preview (optional)'
          }
        },
        required: ['fileName']
      }
    },
  • src/index.js:633-634 (registration)
    Dispatch handler in the MCP server's CallToolRequestSchema that routes calls to the suggestFolder function.
    case 'suggestFolder':
      result = await suggestFolder(args);
  • Input schema definition for the suggestFolder tool, specifying parameters and requirements.
    inputSchema: {
      type: 'object',
      properties: {
        fileName: {
          type: 'string',
          description: 'File name to analyze'
        },
        fileType: {
          type: 'string',
          description: 'Type of file (optional)'
        },
        content: {
          type: 'string',
          description: 'File content preview (optional)'
        }
      },
      required: ['fileName']
    }
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 mentions 'v6 includes 07_META', which suggests some behavioral trait (e.g., version-specific logic or metadata handling), but doesn't explain what this entails—such as how suggestions are generated, whether it's read-only or has side effects, or any limitations. This leaves significant gaps in understanding the tool's 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 concise and front-loaded with the main purpose. The single sentence is efficient, though the parenthetical note 'v6 includes 07_META' could be integrated more smoothly. There's no wasted text, making it easy to parse, but it lacks structural elements like examples or bullet points that might aid clarity.

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 complexity of a suggestion tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., folder name, path, confidence score), how suggestions are determined, or any error conditions. The mention of 'v6 includes 07_META' adds some context but is insufficient for full understanding, leaving key aspects undocumented.

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?

The schema description coverage is 100%, with clear descriptions for all three parameters (fileName, fileType, content). The description adds no additional meaning beyond the schema, as it doesn't elaborate on how these parameters influence the suggestion. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, but the description doesn't compensate or enhance parameter understanding.

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 as suggesting an appropriate folder for a file, which is clear but vague. It mentions 'v6 includes 07_META' which adds some specificity but doesn't fully explain what this means or how it distinguishes from sibling tools like 'checkFolderPermission' or 'createProjectStructure'. The purpose is understandable but lacks detailed differentiation.

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 sibling tools like 'checkFolderPermission', 'createProjectStructure', and 'scanProject', there's no indication of context, prerequisites, or exclusions. The mention of 'v6 includes 07_META' hints at a version-specific feature but doesn't clarify usage scenarios.

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