Skip to main content
Glama
Platano78

Smart-AI-Bridge

validate_changes

Validate proposed code changes using AI-powered syntax checking and impact analysis to prevent errors before implementation.

Instructions

Pre-flight validation for code changes - AI-powered syntax checking and impact analysis. Validates proposed modifications before implementation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
proposed_changesYes
languageNo
validation_rulesNo

Implementation Reference

  • The ValidateChangesHandler class that implements the tool logic. It validates proposed code changes by checking each change for potential null/undefined values if 'syntax' is in validation_rules, then returns a summary with validation results.
    /**
     * Validate changes handler
     */
    class ValidateChangesHandler extends BaseHandler {
      async execute(args) {
        const { file_path, proposed_changes, validation_rules = ['syntax'] } = args;
    
        const validationResults = [];
    
        for (const change of proposed_changes) {
          const result = {
            find: change.find,
            replace: change.replace,
            valid: true,
            warnings: [],
            suggestions: []
          };
    
          // Basic validation
          if (validation_rules.includes('syntax')) {
            if (change.replace.includes('undefined') || change.replace.includes('null')) {
              result.warnings.push('Potential null/undefined values detected');
            }
          }
    
          validationResults.push(result);
        }
    
        return {
          success: true,
          file_path,
          total_changes: proposed_changes.length,
          valid_changes: validationResults.filter(r => r.valid).length,
          validation_results: validationResults
        };
      }
    }
  • The tool definition for 'validate_changes' including its name, description, handler mapping (handleValidateChanges), and JSON schema defining inputs: file_path (string, required), proposed_changes (array of {find, replace, line_number}, required), language (string), validation_rules (array of strings, default: ['syntax','logic','security','performance']).
    {
      name: 'validate_changes',
      description: 'Pre-flight validation for code changes - AI-powered syntax checking and impact analysis. Validates proposed modifications before implementation.',
      handler: 'handleValidateChanges',
      schema: {
        type: 'object',
        properties: {
          file_path: { type: 'string' },
          proposed_changes: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                find: { type: 'string' },
                replace: { type: 'string' },
                line_number: { type: 'number' }
              },
              required: ['find', 'replace']
            }
          },
          language: { type: 'string' },
          validation_rules: {
            type: 'array',
            items: { type: 'string' },
            default: ['syntax', 'logic', 'security', 'performance']
          }
        },
        required: ['file_path', 'proposed_changes']
      }
    },
  • Registration of 'handleValidateChanges' mapping to ValidateChangesHandler class in the HANDLER_REGISTRY object.
    'handleValidateChanges': ValidateChangesHandler,
  • Export of the ValidateChangesHandler class from the handlers module.
    ValidateChangesHandler,
  • Export of ValidateChangesHandler from system-handlers.js, which is then imported by handlers/index.js.
    export {
      HealthHandler,
      ValidateChangesHandler,
      ManageConversationHandler,
      GetAnalyticsHandler
    };
Behavior2/5

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

With no annotations provided, the description does not sufficiently disclose behavioral traits. It states 'AI-powered syntax checking and impact analysis' but does not explain what happens on failure, performance implications, or limitations.

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

Conciseness3/5

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

The description is two sentences but contains some redundancy ('validation' repeated). It could be more concise and front-load the key capability.

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 4 parameters and no output schema, the description is incomplete. It does not cover input format, output format, error handling, or usage constraints, leaving the agent with insufficient context for correct invocation.

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

Parameters1/5

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

Input schema has 0% description coverage; the description adds no meaning to parameters like 'file_path', 'proposed_changes', 'language', or 'validation_rules'. It fails to explain their roles or constraints.

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 tool performs 'pre-flight validation', 'syntax checking and impact analysis', and 'validates proposed modifications before implementation'. It distinguishes from siblings like 'modify_file' by focusing on validation before action.

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 implies usage before implementation but lacks explicit guidance on when to use this tool vs alternatives like 'modify_file' or 'analyze_file'. No exclusions or prerequisites are mentioned.

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/Platano78/Smart-AI-Bridge'

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