Get a repo's contributor stats
Read per-contributor commit totals for a repository, and handle GitHub’s asynchronous-computation case correctly.
-
Call
get_repo_contributor_statswith the repository’s owner and name:get_repo_contributor_stats { owner: "octocat", repo: "example" } -
Check the
computingfield before readingcontributors:{"computing": false,"contributors": [{ "login": "octocat", "total": 214 },{ "login": null, "total": 3 }]}A
nulllogin means GitHub couldn’t map that commit author to a GitHub account. Each entry’stotalis that contributor’s all-time commit count on this repository. -
If
computingistrue, GitHub is still computing the stats after a cache miss andcontributorswill be an empty array — this is not the real answer. Wait a few seconds and call the same tool again with the sameowner/repountilcomputingcomes backfalse.
If it fails
Section titled “If it fails”missing_scope: no GitHub token was resolvable. SetGITHUB_TOKENor rungh auth login.github_api_errorwith a 403: a genuine permission denial (rate-limited 403s are retried automatically up to three times first).
See also
Section titled “See also”- reference/tools.md for the exact response schema and the cache-miss behavior this tool wraps.