Skip to main content
Glama

list_commits

Retrieve recent commits from a GitHub repository by specifying the owner and repository name to track code changes and development history.

Instructions

List recent commits for a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYes
repoYes

Implementation Reference

  • The handler function for the 'list_commits' tool. It validates the owner and repo arguments, checks for GitHub token configuration, and calls the GitHubClient's listCommits method.
    async list_commits(args: Record<string, unknown>) { if (!cfg.githubToken) throw new Error("GITHUB_TOKEN is not configured"); const owner = String(args.owner || ""); const repo = String(args.repo || ""); if (!owner || !repo) throw new Error("owner and repo are required"); return client.listCommits(owner, repo); },
  • The input schema defining the required 'owner' and 'repo' string parameters for the list_commits tool.
    inputSchema: { type: "object", properties: { owner: { type: "string" }, repo: { type: "string" }, }, required: ["owner", "repo"], },
  • The tool registration object that defines the name, description, and input schema for 'list_commits' within the registerGitHub function.
    { name: "list_commits", description: "List recent commits for a repository", inputSchema: { type: "object", properties: { owner: { type: "string" }, repo: { type: "string" }, }, required: ["owner", "repo"], }, },
  • The GitHubClient helper method that makes the API request to list commits for the given repository.
    listCommits(owner: string, repo: string) { return this.request(`/repos/${owner}/${repo}/commits`); }

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/TaylorChen/muti-mcps'

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