Skip to main content
Glama

get_git_log_all_repos

Retrieve git commits from multiple repositories to track coding activity for CV/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 core handler function that executes the tool logic: fetches git logs from all configured repositories (using AUTHOR_NAME filter, no-merges, since parameter), formats output grouped by repo with commit counts and totals.
    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)]
  • Tool registration in @app.list_tools(), defining the tool name, description, and input schema (since parameter with default).
    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" } } } ),
  • Input schema definition for the tool, specifying the 'since' parameter as a string with description and default value.
    inputSchema={ "type": "object", "properties": { "since": { "type": "string", "description": "Time range for commits", "default": "6 months ago" } } }
  • Dispatch/registration in @app.call_tool(): maps tool name to the handler function call, passing 'since' argument with default.
    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