Skip to main content
Glama

list_commits

Retrieve recent commits for a GitHub repository by specifying the owner and repo details. Part of the Multi-MCPs server, which integrates multiple APIs for streamlined access to various web services.

Instructions

List recent commits for a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYes
repoYes

Implementation Reference

  • Handler function for the 'list_commits' tool. Validates inputs (owner, repo) and token configuration, then 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); },
  • Input schema definition for the 'list_commits' tool, specifying owner and repo as required string properties.
    inputSchema: { type: "object", properties: { owner: { type: "string" }, repo: { type: "string" }, }, required: ["owner", "repo"], },
  • Registration of the 'list_commits' tool within the GitHub tools array returned by registerGitHub().
    { name: "list_commits", description: "List recent commits for a repository", inputSchema: { type: "object", properties: { owner: { type: "string" }, repo: { type: "string" }, }, required: ["owner", "repo"], }, },
  • Helper method in GitHubClient class that makes the API request to list commits for a 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