Skip to main content
Glama
ValidateArchitect.ts1.93 kB
/** * 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, }; } } }

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/AgiFlow/aicode-toolkit'

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