/**
* ValidateArchitect
*
* DESIGN PATTERNS:
* - Tool pattern with getDefinition() and execute() methods
* - Service delegation for business logic
* - JSON Schema validation for inputs
*
* CODING STANDARDS:
* - Implement Tool interface from ../types
* - Use TOOL_NAME constant with snake_case (e.g., 'file_read')
* - Return CallToolResult with content array
* - Handle errors with isError flag
* - Delegate complex logic to services
*
* AVOID:
* - Complex business logic in execute method
* - Unhandled promise rejections
* - Missing input validation
*/
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
import type { Tool, ToolDefinition } from '../types/index';
interface ValidateArchitectInput {
input: string;
}
export class ValidateArchitect implements Tool<ValidateArchitectInput> {
static readonly TOOL_NAME = 'validate_architect';
getDefinition(): ToolDefinition {
return {
name: ValidateArchitect.TOOL_NAME,
description: 'Validate an architect.yaml file for syntax and schema errors. Returns detailed, actionable error messages to help fix issues.',
inputSchema: {
type: 'object',
properties: {
input: {
type: 'string',
description: 'Input data',
},
},
required: ['input'],
additionalProperties: false,
},
};
}
async execute(input: ValidateArchitectInput): Promise<CallToolResult> {
try {
// TODO: Implement tool logic
const result = input.input;
return {
content: [
{
type: 'text',
text: result,
},
],
};
} catch (error) {
return {
content: [
{
type: 'text',
text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`,
},
],
isError: true,
};
}
}
}