Skip to main content
Glama

vale_sync

Download Vale styles and packages to resolve missing styles directory errors by reading .vale.ini configuration and fetching required style packages.

Instructions

Download Vale styles and packages by running 'vale sync'. Use this when you see errors about missing styles directories (E100 errors like 'The path does not exist'). This command reads the .vale.ini configuration and downloads the required style packages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
config_pathNoOptional path to .vale.ini file. If not provided, uses the server's configured path or searches in the current directory.

Implementation Reference

  • src/index.ts:212-225 (registration)
    Registers the 'vale_sync' tool including its name, description, and input schema for MCP tool listing.
    { name: "vale_sync", description: "Download Vale styles and packages by running 'vale sync'. Use this when you see errors about missing styles directories (E100 errors like 'The path does not exist'). This command reads the .vale.ini configuration and downloads the required style packages.", inputSchema: { type: "object", properties: { config_path: { type: "string", description: "Optional path to .vale.ini file. If not provided, uses the server's configured path or searches in the current directory.", }, }, }, },
  • MCP tool handler for 'vale_sync': validates input, checks Vale installation, invokes syncValeStyles helper, and formats success/error responses.
    case "vale_sync": { const { config_path } = args as { config_path?: string }; debug(`vale_sync called - config_path: ${config_path}`); // Check if Vale is available const valeCheck = await checkValeInstalled(); if (!valeCheck.installed) { return createValeNotInstalledResponse(); } // Determine which config to use const effectiveConfigPath = config_path || valeConfigPath; // Run vale sync const syncResult = await syncValeStyles(effectiveConfigPath); debug(`vale_sync result - success: ${syncResult.success}`); if (syncResult.success) { return { content: [ { type: "text", text: `✅ **Vale Sync Successful** ${syncResult.message} ${syncResult.output ? `**Output:**\n\`\`\`\n${syncResult.output}\n\`\`\`` : ""} The styles have been downloaded and are ready to use. You can now run \`check_file\` again.`, }, ], }; } else { return { content: [ { type: "text", text: `❌ **Vale Sync Failed** ${syncResult.message} ${syncResult.error ? `**Error:**\n\`\`\`\n${syncResult.error}\n\`\`\`` : ""} Please check your .vale.ini configuration and ensure: 1. The StylesPath is correct 2. Packages are properly defined 3. You have internet connectivity to download packages See Vale documentation: https://vale.sh/docs/topics/packages/`, }, ], }; } }
  • Helper function that executes the 'vale sync' CLI command with optional config file, handling execution in appropriate working directory and parsing output/errors.
    export async function syncValeStyles(configPath?: string): Promise<{ success: boolean; message: string; output?: string; error?: string; }> { try { // Build command let command = "vale sync"; let workingDir = process.cwd(); // If config path provided, use its directory as working dir (Fix #9: async file check) if (configPath) { try { await fs.access(configPath, fsSync.constants.R_OK); workingDir = path.dirname(path.resolve(configPath)); command += ` --config="${configPath}"`; } catch { // Config path doesn't exist or isn't readable, use default console.error(`Warning: Config path ${configPath} is not accessible`); } } console.error(`Running: ${command}`); console.error(`Working directory: ${workingDir}`); const { stdout, stderr } = await execAsync(command, { cwd: workingDir, }); const output = stdout + (stderr ? `\n${stderr}` : ""); return { success: true, message: "Vale styles synchronized successfully", output: output.trim(), }; } catch (error) { const errorMsg = error instanceof Error ? error.message : "Unknown error"; return { success: false, message: "Failed to sync Vale styles", error: errorMsg, }; } }

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/theletterf/vale-mcp-server'

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