review_technical_decision
Assess the impact, trade-offs, and risks of a technical decision. Evaluate alternatives and receive expert architectural recommendations tailored to your context.
Instructions
Review and evaluate a technical decision using GLM-4.6 architectural expertise. Assesses impact, trade-offs, alternatives, risks, and provides recommendations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| decision | Yes | The technical decision to review | |
| context | Yes | Context including current architecture, constraints, and objectives |
Implementation Reference
- src/glm-client.ts:159-174 (handler)Handler function that reviews a technical decision by building a prompt with decision and context, then delegates to consultArchitecture() for GLM-4.6 processing.
async reviewTechnicalDecision(decision: string, context: string): Promise<string> { const query = `Review the following technical decision: Decision: ${decision} Context: ${context} Provide: 1. Architectural impact assessment 2. Trade-offs analysis 3. Alternative approaches 4. Risk evaluation 5. Recommendation with justification`; return this.consultArchitecture(query); } - src/index.ts:79-96 (registration)Tool registration with name 'review_technical_decision', description, and inputSchema requiring 'decision' and 'context' string parameters.
{ name: 'review_technical_decision', description: 'Review and evaluate a technical decision using GLM-4.6 architectural expertise. Assesses impact, trade-offs, alternatives, risks, and provides recommendations.', inputSchema: { type: 'object', properties: { decision: { type: 'string', description: 'The technical decision to review', }, context: { type: 'string', description: 'Context including current architecture, constraints, and objectives', }, }, required: ['decision', 'context'], }, }, - src/index.ts:82-96 (schema)Input schema defining two required string parameters: 'decision' and 'context'.
inputSchema: { type: 'object', properties: { decision: { type: 'string', description: 'The technical decision to review', }, context: { type: 'string', description: 'Context including current architecture, constraints, and objectives', }, }, required: ['decision', 'context'], }, }, - src/index.ts:185-196 (registration)Call tool handler case that extracts decision and context args and invokes glmClient.reviewTechnicalDecision().
case 'review_technical_decision': { const { decision, context } = args as { decision: string; context: string }; const response = await glmClient.reviewTechnicalDecision(decision, context); return { content: [ { type: 'text', text: response, }, ], }; } - src/glm-client.ts:68-122 (helper)Helper method consultArchitecture() that reviewTechnicalDecision delegates to. Calls GLM-4.6 API with a system prompt for architecture expertise.
async consultArchitecture(query: string, context?: string): Promise<string> { const systemPrompt = `You are an elite software architecture consultant specializing in enterprise-grade system design, scalability patterns, security architecture, and technical decision-making. Your expertise includes: - Distributed systems architecture and microservices design - Cloud-native patterns and containerization strategies - Database architecture and data modeling - API design (REST, GraphQL, gRPC) - Security architecture and threat modeling - Performance optimization and scalability - DevOps and CI/CD pipeline architecture - Modern frontend and backend frameworks - System integration patterns Provide concise, actionable architectural guidance with enterprise-grade best practices. Focus on technical accuracy, scalability, maintainability, and security.`; const messages: GLMMessage[] = [ { role: 'system', content: systemPrompt }, ]; if (context) { messages.push({ role: 'user', content: `Context:\n${context}\n\nArchitectural Query:\n${query}`, }); } else { messages.push({ role: 'user', content: query }); } const request: GLMRequest = { model: this.model, messages, temperature: 0.7, top_p: 0.9, max_tokens: 4096, stream: false, }; try { const response = await this.client.post<GLMResponse>('/chat/completions', request); if (!response.data.choices || response.data.choices.length === 0) { throw new Error('GLM-4.6 returned empty response'); } return response.data.choices[0].message.content; } catch (error) { if (axios.isAxiosError(error)) { const status = error.response?.status; const message = error.response?.data?.error?.message || error.message; throw new Error(`GLM-4.6 API Error (${status}): ${message}`); } throw error; } }