Skip to main content
Glama
code-alchemist01

Development Tools MCP Server

validate_syntax

Check code files for syntax errors to identify and fix issues before execution. Supports multiple file paths for batch validation.

Instructions

Validate syntax of code files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYesFile paths to validate

Implementation Reference

  • Handler logic for the 'validate_syntax' tool: parses input files, calls validateSyntax helper on each, and returns validation results per file.
    case 'validate_syntax': {
      const files = params.files as string[];
      const codeFiles = await FileReader.readFiles(files.join(','));
      const results = codeFiles.map((file) => {
        const validation = lintingUtils.validateSyntax(
          file.content,
          file.language || 'javascript'
        );
        return {
          file: file.path,
          ...validation,
        };
      });
      return results;
    }
  • Tool registration defining name, description, and input schema for 'validate_syntax'.
    {
      name: 'validate_syntax',
      description: 'Validate syntax of code files',
      inputSchema: {
        type: 'object',
        properties: {
          files: {
            type: 'array',
            items: { type: 'string' },
            description: 'File paths to validate',
          },
        },
        required: ['files'],
      },
    },
  • Input schema defining the expected parameters: array of file paths.
    inputSchema: {
      type: 'object',
      properties: {
        files: {
          type: 'array',
          items: { type: 'string' },
          description: 'File paths to validate',
        },
      },
      required: ['files'],
    },
  • Helper function implementing basic syntax validation by matching braces, parentheses, and brackets for JS/TS code.
    validateSyntax(code: string, language: string): { valid: boolean; errors: string[] } {
      const errors: string[] = [];
    
      if (language === 'javascript' || language === 'typescript') {
        // Basic bracket matching
        const openBracesCount = (code.match(/{/g) || []).length;
        const closeBracesCount = (code.match(/}/g) || []).length;
        if (openBracesCount !== closeBracesCount) {
          errors.push('Unmatched braces');
        }
    
        const openParens = (code.match(/\(/g) || []).length;
        const closeParens = (code.match(/\)/g) || []).length;
        if (openParens !== closeParens) {
          errors.push('Unmatched parentheses');
        }
    
        const openBrackets = (code.match(/\[/g) || []).length;
        const closeBrackets = (code.match(/\]/g) || []).length;
        if (openBrackets !== closeBrackets) {
          errors.push('Unmatched brackets');
        }
      }
    
      return {
        valid: errors.length === 0,
        errors,
      };
    }
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 action ('validate syntax') but doesn't explain what validation entails (e.g., returns errors/warnings, requires specific file types, has performance implications). This leaves significant gaps for a tool with no annotation coverage.

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 unnecessary words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

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?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what the validation output looks like (e.g., success/failure, error details), what file types are supported, or how it differs from similar sibling tools, leaving too many contextual gaps.

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 the 'files' parameter clearly documented as 'File paths to validate'. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline for adequate but unenhanced parameter documentation.

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

Purpose4/5

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

The description clearly states the verb ('validate') and resource ('syntax of code files'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'lint_code' or 'check_typescript' that might perform similar syntax-related functions, preventing a perfect score.

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 many sibling tools like 'lint_code', 'check_typescript', and 'analyze_code_quality', there's no indication of what makes this tool distinct or when it should be preferred over those options.

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/code-alchemist01/development-tools-mcp-Server'

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