Skip to main content
Glama

git-log

View recent commit history from a Git repository to track changes and review project development. Specify directory and number of commits to display.

Instructions

Get recent git commit history

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryNoDirectory path to check git log (defaults to current directory)
countNoNumber of recent commits to show (default: 10)

Implementation Reference

  • Handler for the git-log tool: executes git log command with optional directory and count parameters, returns formatted commit history or error.
    if (name === "git-log") { const { directory, count = 10 }: { directory?: string; count?: number } = args || {}; try { const cwd = directory || process.cwd(); const gitLog = execSync(`git log --oneline -n ${count}`, { cwd: cwd, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }); return { content: [{ type: "text", text: `Recent Git Commits (${count} most recent):\n\n${gitLog}` }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: "text", text: `Error running git log: ${errorMessage}` }], isError: true }; } }
  • src/index.ts:43-60 (registration)
    Registration of the git-log tool in the ListToolsRequestHandler response, including name, description, and input schema.
    { name: "git-log", description: "Get recent git commit history", inputSchema: { type: "object", properties: { directory: { type: "string", description: "Directory path to check git log (defaults to current directory)" }, count: { type: "number", description: "Number of recent commits to show (default: 10)", default: 10 } } } }
  • Input schema definition for the git-log tool, specifying directory and count parameters.
    inputSchema: { type: "object", properties: { directory: { type: "string", description: "Directory path to check git log (defaults to current directory)" }, count: { type: "number", description: "Number of recent commits to show (default: 10)", default: 10 } } }
Install Server

Other 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/narayana-reddy-circles/mcp-git-status'

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