Skip to main content
Glama

get_git_log_by_repo

Retrieve git commit history from a specified repository to automatically populate CV/resume project sections with recent development activity.

Instructions

Get git commits from a specific repository by name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_nameYesName of the repository (e.g., 'CompanyA', 'Personal')
sinceNoTime range for commits6 months ago

Implementation Reference

  • The core handler function that implements the tool logic: validates repo_name, retrieves repo path from config, executes git log command filtered by author and since date, excludes merges, formats output with commit hash, message, and relative date.
    async def get_git_log_by_repo(repo_name: Optional[str], since: str) -> list[TextContent]: """Get git commits from a specific repository.""" if not repo_name: return [TextContent(type="text", text="Error: repo_name is required")] if not REPO_DICT: return [TextContent(type="text", text="No repositories configured")] if repo_name not in REPO_DICT: available = ", ".join(REPO_DICT.keys()) return [TextContent( type="text", text=f"Repository '{repo_name}' not found.\n\nAvailable repositories: {available}" )] repo_path = REPO_DICT[repo_name] 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() return [TextContent( type="text", text=f"Git commits from '{repo_name}' ({repo_path}):\n\n{output if output else 'No commits found'}" )] except subprocess.CalledProcessError as e: return [TextContent(type="text", text=f"Git error for '{repo_name}': {e.stderr}")]
  • The tool schema definition including name, description, input schema with repo_name (required) and since (optional, default '6 months ago'), registered in the list_tools() function.
    Tool( name="get_git_log_by_repo", description="Get git commits from a specific repository by name", inputSchema={ "type": "object", "properties": { "repo_name": { "type": "string", "description": "Name of the repository (e.g., 'CompanyA', 'Personal')" }, "since": { "type": "string", "description": "Time range for commits", "default": "6 months ago" } }, "required": ["repo_name"] } ),
  • Tool dispatch/registration in the main call_tool handler: matches tool name and calls the get_git_log_by_repo function with parsed arguments.
    elif name == "get_git_log_by_repo": return await get_git_log_by_repo( arguments.get("repo_name"), 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