Skip to main content
Glama

get_git_log_all_repos

Retrieve git commits from multiple repositories to track coding contributions for resume building, with time-based filtering options.

Instructions

Get git commits from all configured repositories, grouped by repo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceNoTime range for commits6 months ago

Implementation Reference

  • The main handler function that implements the get_git_log_all_repos tool. It iterates over all configured repositories, runs git log for the author since the specified time, groups the output by repository, counts commits, and returns formatted TextContent.
    async def get_git_log_all_repos(since: str) -> list[TextContent]: """Get git commits from all configured repositories.""" if not REPO_DICT: return [TextContent(type="text", text="No repositories configured")] all_output = f"Git commits from all repositories ({since}):\n\n" all_output += "="*60 + "\n\n" total_commits = 0 for repo_name, repo_path in REPO_DICT.items(): try: cmd = [ "git", "log", f"--author={AUTHOR_NAME}", "--no-merges", f"--since={since}", "--pretty=format:%h - %s (%cr)" ] result = subprocess.run( cmd, cwd=repo_path, capture_output=True, text=True, check=True ) output = result.stdout.strip() commit_count = len(output.split('\n')) if output else 0 total_commits += commit_count all_output += f"## {repo_name}\n" all_output += f"Path: {repo_path}\n" all_output += f"Commits: {commit_count}\n\n" if output: all_output += output + "\n\n" else: all_output += "No commits found\n\n" all_output += "-"*60 + "\n\n" except subprocess.CalledProcessError as e: all_output += f"## {repo_name}\n" all_output += f"Error: {e.stderr}\n\n" all_output += "-"*60 + "\n\n" all_output += f"Total commits across all repositories: {total_commits}" return [TextContent(type="text", text=all_output)]
  • Registers the get_git_log_all_repos tool in the MCP server's list_tools() function, including its name, description, and input schema.
    Tool( name="get_git_log_all_repos", description="Get git commits from all configured repositories, grouped by repo", inputSchema={ "type": "object", "properties": { "since": { "type": "string", "description": "Time range for commits", "default": "6 months ago" } } } ),
  • Dispatch logic in the call_tool handler that routes calls to the get_git_log_all_repos function.
    elif name == "get_git_log_all_repos": return await get_git_log_all_repos(arguments.get("since", "6 months ago"))

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/eyaab/cv-resume-builder-mcp'

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