get_developer_analysis
Analyze GitHub developer activity and contributions to understand their open source impact and coding patterns.
Instructions
Get detailed analysis of a GitHub developer, including their activity and contributions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | GitHub username |
Implementation Reference
- index.ts:183-206 (handler)The core handler function that fetches GitHub developer analysis data from the OSSInsight API (/users/{username}) or falls back to web scraping the OSSInsight page if the API fails.async function getDeveloperAnalysis(username: string): Promise<any> { try { // Get user information through API if available const userData = await apiRequest(`/users/${username}`); return { user_data: userData }; } catch (error) { // If API fails, rely on web page data console.error(`API request failed, falling back to web scraping: ${error}`); const webUrl = `${OSSINSIGHT_WEB_URL}/analyze/user/${username}`; return { web_data: await scrapeOSSInsightPage(webUrl, { name: 'h1', bio: '.user-bio', repos: '.repos-count', // Add more selectors as needed }), web_url: webUrl }; } }
- schemas.ts:10-12 (schema)Zod schema defining the input parameters for the tool: a required 'username' string.export const GetDeveloperAnalysisParamsSchema = z.object({ username: z.string().describe("GitHub username") });
- index.ts:292-296 (registration)Tool registration in the MCP listTools handler, providing name, description, and converted JSON schema.{ name: "get_developer_analysis", description: "Get detailed analysis of a GitHub developer, including their activity and contributions.", inputSchema: zodToJsonSchema(GetDeveloperAnalysisParamsSchema) },
- index.ts:330-333 (handler)Dispatch handler in the MCP callTool request that parses arguments using the schema and invokes the getDeveloperAnalysis function.case "get_developer_analysis": { const args = GetDeveloperAnalysisParamsSchema.parse(request.params.arguments); const analysis = await getDeveloperAnalysis(args.username); return { content: [{ type: "text", text: JSON.stringify(analysis, null, 2) }] };