Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf88456f

Browse files
authored
Update list commits tool description (#629)
1 parent6043bec commitf88456f

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
903903
-`page`: Page number for pagination (min 1) (number, optional)
904904
-`perPage`: Results per page for pagination (min 1, max 100) (number, optional)
905905
-`repo`: Repository name (string, required)
906-
-`sha`: SHAorBranch name (string, optional)
906+
-`sha`:The commitSHA, branch name,ortag name to list commits from. If not specified, defaults to the repository's default branch. (string, optional)
907907

908908
-**list_tags** - List tags
909909
-`owner`: Repository owner (string, required)

‎pkg/github/__toolsnaps__/list_commits.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"title":"List commits",
44
"readOnlyHint":true
55
},
6-
"description":"Get list of commits of a branch in a GitHub repository",
6+
"description":"Get list of commits of a branch in a GitHub repository. Returns at least 30 results per page by default, but can return more if specified using the perPage parameter (up to 100).",
77
"inputSchema": {
88
"properties": {
99
"author": {
@@ -30,7 +30,7 @@
3030
"type":"string"
3131
},
3232
"sha": {
33-
"description":"SHAorBranch name",
33+
"description":"The commitSHA, branch name,ortag name to list commits from. If not specified, defaults to the repository's default branch.",
3434
"type":"string"
3535
}
3636
},

‎pkg/github/repositories.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func GetCommit(getClient GetClientFn, t translations.TranslationHelperFunc) (too
9797
// ListCommits creates a tool to get commits of a branch in a repository.
9898
funcListCommits(getClientGetClientFn,t translations.TranslationHelperFunc) (tool mcp.Tool,handler server.ToolHandlerFunc) {
9999
returnmcp.NewTool("list_commits",
100-
mcp.WithDescription(t("TOOL_LIST_COMMITS_DESCRIPTION","Get list of commits of a branch in a GitHub repository")),
100+
mcp.WithDescription(t("TOOL_LIST_COMMITS_DESCRIPTION","Get list of commits of a branch in a GitHub repository. Returns at least 30 results per page by default, but can return more if specified using the perPage parameter (up to 100).")),
101101
mcp.WithToolAnnotation(mcp.ToolAnnotation{
102102
Title:t("TOOL_LIST_COMMITS_USER_TITLE","List commits"),
103103
ReadOnlyHint:ToBoolPtr(true),
@@ -111,7 +111,7 @@ func ListCommits(getClient GetClientFn, t translations.TranslationHelperFunc) (t
111111
mcp.Description("Repository name"),
112112
),
113113
mcp.WithString("sha",
114-
mcp.Description("SHAorBranch name"),
114+
mcp.Description("The commitSHA, branch name,ortag name to list commits from. If not specified, defaults to the repository's default branch."),
115115
),
116116
mcp.WithString("author",
117117
mcp.Description("Author username or email address"),
@@ -139,13 +139,17 @@ func ListCommits(getClient GetClientFn, t translations.TranslationHelperFunc) (t
139139
iferr!=nil {
140140
returnmcp.NewToolResultError(err.Error()),nil
141141
}
142-
142+
// Set default perPage to 30 if not provided
143+
perPage:=pagination.perPage
144+
ifperPage==0 {
145+
perPage=30
146+
}
143147
opts:=&github.CommitsListOptions{
144148
SHA:sha,
145149
Author:author,
146150
ListOptions: github.ListOptions{
147151
Page:pagination.page,
148-
PerPage:pagination.perPage,
152+
PerPage:perPage,
149153
},
150154
}
151155

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp