Skip to content

Commit 6036235

Browse files
authored
Remove pagination for now
1 parent 3d3cc20 commit 6036235

File tree

4 files changed

+2
-37
lines changed

4 files changed

+2
-37
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,6 @@ The following sets of tools are available (all are on by default):
664664
- `project_number`: The project's number (number, required)
665665

666666
- **list_projects** - List projects
667-
- `after`: Cursor for items after (forward pagination) (string, optional)
668-
- `before`: Cursor for items before (backwards pagination) (string, optional)
669667
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == organization it is the name of the organization. The name is not case sensitive. (string, required)
670668
- `owner_type`: Owner type (string, required)
671669
- `per_page`: Number of results per page (max 100, default: 30) (number, optional)

pkg/github/__toolsnaps__/list_projects.snap

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
"description": "List Projects for a user or organization",
77
"inputSchema": {
88
"properties": {
9-
"after": {
10-
"description": "Cursor for items after (forward pagination)",
11-
"type": "string"
12-
},
13-
"before": {
14-
"description": "Cursor for items before (backwards pagination)",
15-
"type": "string"
16-
},
179
"owner": {
1810
"description": "If owner_type == user it is the handle for the GitHub user account. If owner_type == organization it is the name of the organization. The name is not case sensitive.",
1911
"type": "string"

pkg/github/projects.go

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ func ListProjects(getClient GetClientFn, t translations.TranslationHelperFunc) (
2424
mcp.WithString("owner_type", mcp.Required(), mcp.Description("Owner type"), mcp.Enum("user", "organization")),
2525
mcp.WithString("owner", mcp.Required(), mcp.Description("If owner_type == user it is the handle for the GitHub user account. If owner_type == organization it is the name of the organization. The name is not case sensitive.")),
2626
mcp.WithString("query", mcp.Description("Filter projects by a search query (matches title and description)")),
27-
mcp.WithString("before", mcp.Description("Cursor for items before (backwards pagination)")),
28-
mcp.WithString("after", mcp.Description("Cursor for items after (forward pagination)")),
2927
mcp.WithNumber("per_page", mcp.Description("Number of results per page (max 100, default: 30)")),
3028
), func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) {
3129
owner, err := RequiredParam[string](req, "owner")
@@ -40,15 +38,6 @@ func ListProjects(getClient GetClientFn, t translations.TranslationHelperFunc) (
4038
if err != nil {
4139
return mcp.NewToolResultError(err.Error()), nil
4240
}
43-
44-
beforeCursor, err := OptionalParam[string](req, "before")
45-
if err != nil {
46-
return mcp.NewToolResultError(err.Error()), nil
47-
}
48-
afterCursor, err := OptionalParam[string](req, "after")
49-
if err != nil {
50-
return mcp.NewToolResultError(err.Error()), nil
51-
}
5241
perPage, err := OptionalIntParamWithDefault(req, "per_page", 30)
5342
if err != nil {
5443
return mcp.NewToolResultError(err.Error()), nil
@@ -68,12 +57,7 @@ func ListProjects(getClient GetClientFn, t translations.TranslationHelperFunc) (
6857
projects := []github.ProjectV2{}
6958

7059
opts := ListProjectsOptions{PerPage: perPage}
71-
if afterCursor != "" {
72-
opts.After = afterCursor
73-
}
74-
if beforeCursor != "" {
75-
opts.Before = beforeCursor
76-
}
60+
7761
if queryStr != "" {
7862
opts.Query = queryStr
7963
}
@@ -183,12 +167,6 @@ func GetProject(getClient GetClientFn, t translations.TranslationHelperFunc) (to
183167
}
184168

185169
type ListProjectsOptions struct {
186-
// A cursor, as given in the Link header. If specified, the query only searches for events before this cursor.
187-
Before string `url:"before,omitempty"`
188-
189-
// A cursor, as given in the Link header. If specified, the query only searches for events after this cursor.
190-
After string `url:"after,omitempty"`
191-
192170
// For paginated result sets, the number of results to include per page.
193171
PerPage int `url:"per_page,omitempty"`
194172

pkg/github/projects_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ func Test_ListProjects(t *testing.T) {
2525
assert.Contains(t, tool.InputSchema.Properties, "owner")
2626
assert.Contains(t, tool.InputSchema.Properties, "owner_type")
2727
assert.Contains(t, tool.InputSchema.Properties, "query")
28-
assert.Contains(t, tool.InputSchema.Properties, "before")
29-
assert.Contains(t, tool.InputSchema.Properties, "after")
3028
assert.Contains(t, tool.InputSchema.Properties, "per_page")
3129
assert.ElementsMatch(t, tool.InputSchema.Required, []string{"owner", "owner_type"})
3230

@@ -80,7 +78,7 @@ func Test_ListProjects(t *testing.T) {
8078
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
8179
q := r.URL.Query()
8280
// Assert query params present
83-
if q.Get("after") == "cursor123" && q.Get("per_page") == "50" && q.Get("q") == "roadmap" {
81+
if q.Get("per_page") == "50" && q.Get("q") == "roadmap" {
8482
w.WriteHeader(http.StatusOK)
8583
_, _ = w.Write(mock.MustMarshal(orgProjects))
8684
return
@@ -93,7 +91,6 @@ func Test_ListProjects(t *testing.T) {
9391
requestArgs: map[string]interface{}{
9492
"owner": "octo-org",
9593
"owner_type": "organization",
96-
"after": "cursor123",
9794
"per_page": float64(50),
9895
"query": "roadmap",
9996
},

0 commit comments

Comments
 (0)