Skip to main content
Glama

migrate_file_naming

Convert Memory Bank file names from camelCase to kebab-case using the MCP server with SSH support for efficient file system standardization.

Instructions

Migrate Memory Bank files from camelCase to kebab-case naming convention

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
random_stringYesDummy parameter for no-parameter tools

Implementation Reference

  • Main handler function for the 'migrate_file_naming' tool. It validates the memory bank directory existence, calls the migration method on MemoryBankManager, and formats the response.
    export async function handleMigrateFileNaming(
      memoryBankManager: MemoryBankManager
    ) {
      try {
        if (!memoryBankManager.getMemoryBankDir()) {
          return {
            content: [
              {
                type: "text",
                text: 'Memory Bank directory not found. Use initialize_memory_bank or set_memory_bank_path first.',
              },
            ],
          };
        }
    
        const result = await memoryBankManager.migrateFileNaming();
        return {
          content: [
            {
              type: "text",
              text: `Migration completed. ${result.migrated.length} files migrated.`,
            },
          ],
        };
      } catch (error) {
        console.error("Error in handleMigrateFileNaming:", error);
        return {
          content: [
            {
              type: "text",
              text: `Error migrating file naming: ${error}`,
            },
          ],
        };
      }
    }
  • Tool schema definition including name, description, and input schema (dummy param for no-args tool).
    {
      name: 'migrate_file_naming',
      description: 'Migrate Memory Bank files from camelCase to kebab-case naming convention',
      inputSchema: {
        type: 'object',
        properties: {
          random_string: {
            type: 'string',
            description: 'Dummy parameter for no-parameter tools',
          },
        },
        required: ['random_string'],
      },
    },
  • Dispatch case in the main tool call handler that routes 'migrate_file_naming' calls to the specific handler.
    case 'migrate_file_naming': {
      return handleMigrateFileNaming(memoryBankManager);
    }
  • MCP server registration for listing tools, which includes the coreTools array containing 'migrate_file_naming'.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        ...coreTools,
        ...progressTools,
        ...contextTools,
        ...decisionTools,
        ...modeTools,
      ],
    }));
  • Supporting utility that performs the actual file renaming from camelCase (e.g., productContext.md) to kebab-case (product-context.md). Called indirectly via MemoryBankManager.
    static async migrateFileNamingConvention(memoryBankDir: string): Promise<{
      success: boolean;
      migratedFiles: string[];
      errors: string[];
    }> {
      const result = {
        success: true,
        migratedFiles: [] as string[],
        errors: [] as string[],
      };
    
      // File mapping from old to new naming convention
      const fileMapping = [
        { oldName: 'productContext.md', newName: 'product-context.md' },
        { oldName: 'activeContext.md', newName: 'active-context.md' },
        { oldName: 'decisionLog.md', newName: 'decision-log.md' },
        { oldName: 'systemPatterns.md', newName: 'system-patterns.md' },
      ];
    
      // Check if directory exists
      if (!(await FileUtils.fileExists(memoryBankDir)) || !(await FileUtils.isDirectory(memoryBankDir))) {
        result.success = false;
        result.errors.push(`Memory Bank directory not found: ${memoryBankDir}`);
        return result;
      }
    
      // Process each file
      for (const mapping of fileMapping) {
        const oldPath = path.join(memoryBankDir, mapping.oldName);
        const newPath = path.join(memoryBankDir, mapping.newName);
    
        try {
          // Check if old file exists
          if (await FileUtils.fileExists(oldPath)) {
            // Check if new file already exists
            if (await FileUtils.fileExists(newPath)) {
              result.errors.push(`Target file already exists: ${mapping.newName}`);
              continue;
            }
    
            // Read content from old file
            const content = await FileUtils.readFile(oldPath);
            
            // Write content to new file
            await FileUtils.writeFile(newPath, content);
            
            // Delete old file
            await FileUtils.deleteFile(oldPath);
            
            result.migratedFiles.push(mapping.oldName);
          }
        } catch (error) {
          result.success = false;
          result.errors.push(`Error migrating ${mapping.oldName}: ${error}`);
        }
      }
    
      return result;
    }
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 migration action but lacks critical details: whether this is a destructive operation (e.g., renames files in place), requires specific permissions, handles errors, or provides progress feedback. For a tool that likely modifies file names, this omission is significant.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 lack of annotations and output schema, and the tool's likely complexity (migrating file names), the description is incomplete. It does not explain what the migration entails (e.g., batch processing, dry-run options), potential side effects, or return values, leaving gaps for safe and effective use by an agent.

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

Parameters4/5

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

The input schema has 100% coverage with one parameter described as a 'Dummy parameter for no-parameter tools', indicating no meaningful parameters. The description does not add parameter details beyond this, but with zero functional parameters, the baseline is 4 as the schema adequately handles the dummy case without needing extra explanation in the description.

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

Purpose5/5

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

The description clearly states the specific action ('Migrate') and resource ('Memory Bank files'), with precise details about the naming convention change ('from camelCase to kebab-case'). It distinguishes this tool from siblings like 'list_memory_bank_files' or 'write_memory_bank_file' by focusing on a migration operation rather than listing, reading, or writing files.

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, such as whether it should be run once during setup or as needed for file consistency. It does not mention prerequisites, exclusions, or related tools, leaving the agent to infer usage context from the tool name alone.

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

Related 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/aakarsh-sasi/memory-bank-mcp'

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