Skip to main content
Glama

vale_sync

Download Vale style packages to resolve missing styles errors by reading configuration files and fetching required resources.

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

  • Main execution handler for the 'vale_sync' tool. Validates input, checks Vale installation, determines config path, calls 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/`,
                  },
                ],
              };
            }
          }
  • Tool definition and input schema for 'vale_sync', specifying the optional config_path parameter.
    {
      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.",
          },
        },
      },
    },
  • src/index.ts:244-248 (registration)
    Registration of tool list handler that includes 'vale_sync' in the available tools returned to clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: TOOLS,
      };
    });
  • Helper function that executes the 'vale sync' CLI command with optional config file, handling working directory and returning success/error with output.
    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,
        };
      }
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains that the tool downloads packages based on configuration and mentions it reads '.vale.ini', which is useful context. However, it doesn't disclose important behavioral aspects like whether this requires network access, what happens if downloads fail, or if there are any side effects on existing files.

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 perfectly concise with three sentences that each serve a distinct purpose: stating what the tool does, when to use it, and how it works. There's no redundancy or wasted words, and the information is front-loaded with the most important details first.

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

Completeness4/5

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

Given the tool's moderate complexity (single optional parameter, no output schema, no annotations), the description provides good contextual coverage. It explains the purpose, usage scenario, and basic operation. The main gap is the lack of output information or error handling details, but for a configuration-based download tool, this is reasonably complete.

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%, so the schema already documents the single parameter completely. The description doesn't add any additional parameter semantics beyond what's in the schema - it mentions the configuration file but doesn't provide additional context about the parameter's usage or implications. This meets the baseline expectation when schema coverage is high.

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 ('Download Vale styles and packages') and the method ('by running "vale sync"'), distinguishing it from sibling tools like 'check_file' and 'vale_status'. It provides a concrete verb+resource combination that leaves no ambiguity about what the tool does.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('Use this when you see errors about missing styles directories (E100 errors like "The path does not exist")'). It provides a clear trigger condition and distinguishes it from alternatives by specifying the specific error scenario it addresses.

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

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