Skip to main content
Glama

github_activity

Retrieve recent GitHub activity, including commits, issues, pull requests, and releases, with options to limit results and include detailed information.

Instructions

Get Duyet's recent GitHub activity including commits, issues, pull requests, releases, and other public events

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_detailsNoInclude detailed information like commit messages and issue titles
limitNoNumber of recent activities to retrieve (1-20, default: 5)

Implementation Reference

  • The core handler function for the 'github_activity' tool. Fetches GitHub activity data, formats it for display, and returns it as text content. Includes error handling with fallback message.
    async ({ limit = 5, include_details = false }) => { try { const data = await getGitHubActivityData(limit, include_details); const formattedContent = formatGitHubActivityForDisplay(data); return { content: [ { type: "text", text: formattedContent, }, ], }; } catch (error) { console.error("GitHub API error:", error); const errorMessage = error instanceof Error ? error.message : "Unknown error"; const errorContent = `Error fetching GitHub activity: ${errorMessage} GitHub Profile: https://github.com/duyet`; return { content: [ { type: "text", text: errorContent, }, ], }; }
  • Zod-based input schema for the tool parameters: limit (number, 1-20, default 5) and include_details (boolean, default false).
    const limitSchema = z.number().min(1).max(20).optional().default(5) as any; const includeDetailsSchema = z.boolean().optional().default(false) as any; /** * Register the GitHub activity tool */ export function registerGitHubActivityTool(server: McpServer) { server.registerTool( "github_activity", { title: "GitHub Activity", description: "Get Duyet's recent GitHub activity including commits, issues, pull requests, releases, and other public events", inputSchema: { limit: limitSchema.describe("Number of recent activities to retrieve (1-20, default: 5)"), include_details: includeDetailsSchema.describe("Include detailed information like commit messages and issue titles"), },
  • Registers the 'github_activity' tool with the MCP server, defining title, description, input schema, and handler.
    export function registerGitHubActivityTool(server: McpServer) { server.registerTool( "github_activity", { title: "GitHub Activity", description: "Get Duyet's recent GitHub activity including commits, issues, pull requests, releases, and other public events", inputSchema: { limit: limitSchema.describe("Number of recent activities to retrieve (1-20, default: 5)"), include_details: includeDetailsSchema.describe("Include detailed information like commit messages and issue titles"), }, }, async ({ limit = 5, include_details = false }) => { try { const data = await getGitHubActivityData(limit, include_details); const formattedContent = formatGitHubActivityForDisplay(data); return { content: [ { type: "text", text: formattedContent, }, ], }; } catch (error) { console.error("GitHub API error:", error); const errorMessage = error instanceof Error ? error.message : "Unknown error"; const errorContent = `Error fetching GitHub activity: ${errorMessage} GitHub Profile: https://github.com/duyet`; return { content: [ { type: "text", text: errorContent, }, ], }; } }, ); }
  • Top-level registration call for the github_activity tool during initialization of all tools.
    // Content tools registerGitHubActivityTool(server); logger.tool("github_activity", "registered");
  • Helper function called by the tool handler to fetch and cache GitHub activity data from the GitHub API.
    export async function getGitHubActivityData( limit = 5, includeDetails = false, ): Promise<GitHubActivityData> { const limitNum = Math.min(Math.max(limit, 1), 20); const cacheKey = `github-activity-${limitNum}-${includeDetails}`; return cacheOrFetch(cacheKey, CACHE_CONFIGS.GITHUB, () => fetchGitHubActivityData(limitNum, includeDetails), ); }

Other Tools

Related Tools

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/duyet/duyet-mcp-server'

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