Skip to main content
Glama

analyze_tech

Analyze technology with 6-dimension scores to identify strengths, weaknesses, and compatible technologies for development projects.

Instructions

Detailed analysis of a technology with 6-dimension scores, strengths, weaknesses, and compatible technologies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
technologyYesTechnology ID to analyze
contextNoContext for scoring

Implementation Reference

  • Main handler function that executes the analyze_tech tool logic: validates tech existence, computes scores, identifies strengths/weaknesses/compatibles, and generates formatted Markdown analysis output.
    export function executeAnalyzeTech(input: AnalyzeTechInput): { text: string; isError?: boolean } {
    	const { technology, context = 'default' } = input;
    
    	// Check if technology exists
    	if (!techExists(technology)) {
    		const error = techNotFoundError(technology, getAllTechIds());
    		return { text: error.toResponseText(), isError: true };
    	}
    
    	const tech = getTechnology(technology)!;
    	const scores = getScores(technology, context)!;
    	const overallScore = calculateOverallScore(scores);
    	const grade = scoreToGrade(overallScore);
    
    	// Get strengths and weaknesses
    	const { strengths, weaknesses } = analyzeStrengthsWeaknesses(scores);
    
    	// Get compatible technologies
    	const compatible = findCompatibleTechs(technology);
    
    	// Build response
    	let text = `## ${tech.name} Analysis (context: ${context})
    
    **Category**: ${tech.category}
    **Overall Score**: ${overallScore}/100 (${grade})
    **URL**: ${tech.url}
    
    ### Scores by Dimension
    | Dimension | Score | Grade |
    |-----------|-------|-------|
    `;
    
    	for (const dim of SCORE_DIMENSIONS) {
    		const score = scores[dim];
    		text += `| ${DIMENSION_LABELS[dim]} | ${score} | ${scoreToGrade(score)} |\n`;
    	}
    
    	// Strengths
    	if (strengths.length > 0) {
    		text += '\n### Strengths\n';
    		for (const s of strengths) {
    			text += `- **${s.dim}** (${s.score}/100)\n`;
    		}
    	}
    
    	// Weaknesses
    	if (weaknesses.length > 0) {
    		text += '\n### Weaknesses\n';
    		for (const w of weaknesses) {
    			text += `- ${w.dim} (${w.score}/100)\n`;
    		}
    	}
    
    	// Compatible technologies
    	if (compatible.length > 0) {
    		text += '\n### Compatible Technologies (top 8)\n';
    		const compatList = compatible.map((c) => `${c.id} (${c.score})`).join(', ');
    		text += `${compatList}\n`;
    	}
    
    	text += `\nData version: ${DATA_VERSION}`;
    
    	return { text };
    }
  • Zod input schema for parsing and validating arguments to the analyze_tech tool.
    export const AnalyzeTechInputSchema = z.object({
    	technology: z.string().min(1).describe('Technology ID to analyze (e.g., "nextjs", "postgres")'),
    	context: z.enum(CONTEXTS).optional().default('default').describe('Context for score lookup')
    });
  • src/server.ts:71-95 (registration)
    MCP server tool registration for 'analyze_tech', including schema, description, and thin wrapper handler that parses input and delegates to executeAnalyzeTech.
    server.registerTool(
    	analyzeTechToolDefinition.name,
    	{
    		title: 'Analyze Technology',
    		description: analyzeTechToolDefinition.description,
    		inputSchema: {
    			technology: z.string().min(1).describe('Technology ID to analyze'),
    			context: z.enum(CONTEXTS).optional().describe('Context for scoring')
    		},
    		annotations: {
    			readOnlyHint: true,
    			destructiveHint: false,
    			openWorldHint: false
    		}
    	},
    	async (args) => {
    		debug('analyze_tech called', args);
    		const input = AnalyzeTechInputSchema.parse(args);
    		const { text, isError } = executeAnalyzeTech(input);
    		return {
    			content: [{ type: 'text', text }],
    			isError
    		};
    	}
    );
  • MCP-compatible tool definition object used for registration, including name, description, and input schema structure.
    export const analyzeTechToolDefinition = {
    	name: 'analyze_tech',
    	description:
    		'Detailed analysis of a technology with 6-dimension scores, strengths, weaknesses, and compatible technologies.',
    	inputSchema: {
    		type: 'object' as const,
    		properties: {
    			technology: {
    				type: 'string',
    				description: 'Technology ID (e.g., "nextjs", "postgres", "drizzle")'
    			},
    			context: {
    				type: 'string',
    				enum: CONTEXTS,
    				description: 'Context for scoring (default, mvp, enterprise)'
    			}
    		},
    		required: ['technology']
    	}
    };
  • Helper function to compute strengths (top scores >=85) and weaknesses (bottom scores <80) from technology scores.
    function analyzeStrengthsWeaknesses(
    	scores: Scores
    ): { strengths: Array<{ dim: string; score: number }>; weaknesses: Array<{ dim: string; score: number }> } {
    	const sorted = SCORE_DIMENSIONS.map((dim) => ({
    		dim: DIMENSION_LABELS[dim],
    		dimKey: dim,
    		score: scores[dim]
    	})).sort((a, b) => b.score - a.score);
    
    	// Top 2 as strengths (if score >= 85)
    	const strengths = sorted.filter((s) => s.score >= 85).slice(0, 2);
    
    	// Bottom 2 as weaknesses (if score < 80)
    	const weaknesses = sorted
    		.reverse()
    		.filter((s) => s.score < 80)
    		.slice(0, 2);
    
    	return {
    		strengths: strengths.map((s) => ({ dim: s.dim, score: s.score })),
    		weaknesses: weaknesses.map((s) => ({ dim: s.dim, score: s.score }))
    	};
    }

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/hoklims/stacksfinder-mcp'

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