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

Commita4fa908

Browse files
tmelliottjrstephenotalora
authored andcommitted
update pagination rules
1 parentc348bb0 commita4fa908

File tree

5 files changed

+49
-31
lines changed

5 files changed

+49
-31
lines changed

‎pkg/github/__toolsnaps__/list_project_fields.snap‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"inputSchema": {
88
"properties": {
99
"after": {
10-
"description":"Forward pagination cursor. Use when thepreviousresponse'spageInfo.hasNextPage=true. Supply pageInfo.nextCursor as 'after' and immediately request the next page. LOOP UNTIL pageInfo.hasNextPage=false (don't stop early). Keep per_page identical for every page.",
10+
"description":"Forward pagination cursor fromprevious pageInfo.nextCursor.",
1111
"type":"string"
1212
},
1313
"before": {
14-
"description":"Backward pagination cursor(rare): supply to move to the preceding page usingpageInfo.prevCursor. Not needed for normal forward iteration.",
14+
"description":"Backward pagination cursorfrom previouspageInfo.prevCursor (rare).",
1515
"type":"string"
1616
},
1717
"owner": {
@@ -27,7 +27,7 @@
2727
"type":"string"
2828
},
2929
"per_page": {
30-
"description":"Results per page (max 50). Keep constant across paginated requests; changing mid-sequence can complicate page traversal.",
30+
"description":"Results per page (max 50)",
3131
"type":"number"
3232
},
3333
"project_number": {

‎pkg/github/__toolsnaps__/list_project_items.snap‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"inputSchema": {
88
"properties": {
99
"after": {
10-
"description":"Forward pagination cursor. Use when thepreviousresponse'spageInfo.hasNextPage=true. Supply pageInfo.nextCursor as 'after' and immediately request the next page. LOOP UNTIL pageInfo.hasNextPage=false (don't stop early). Keep query, fields, and per_page identical for every page.",
10+
"description":"Forward pagination cursor fromprevious pageInfo.nextCursor.",
1111
"type":"string"
1212
},
1313
"before": {
14-
"description":"Backward pagination cursor(rare): supply to move to the preceding page usingpageInfo.prevCursor. Not needed for normal forward iteration.",
14+
"description":"Backward pagination cursorfrom previouspageInfo.prevCursor (rare).",
1515
"type":"string"
1616
},
1717
"fields": {
@@ -34,7 +34,7 @@
3434
"type":"string"
3535
},
3636
"per_page": {
37-
"description":"Results per page (max 50). Keep constant across paginated requests; changing mid-sequence can complicate page traversal.",
37+
"description":"Results per page (max 50)",
3838
"type":"number"
3939
},
4040
"project_number": {

‎pkg/github/__toolsnaps__/list_projects.snap‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"inputSchema": {
88
"properties": {
99
"after": {
10-
"description":"Forward pagination cursor. Use when thepreviousresponse'spageInfo.hasNextPage=true. Supply pageInfo.nextCursor as 'after' and immediately request the next page. LOOP UNTIL pageInfo.hasNextPage=false (don't stop early). Keep query and per_page identical for every page.",
10+
"description":"Forward pagination cursor fromprevious pageInfo.nextCursor.",
1111
"type":"string"
1212
},
1313
"before": {
14-
"description":"Backward pagination cursor(rare): supply to move to the preceding page usingpageInfo.prevCursor. Not needed for normal forward iteration.",
14+
"description":"Backward pagination cursorfrom previouspageInfo.prevCursor (rare).",
1515
"type":"string"
1616
},
1717
"owner": {
@@ -27,7 +27,7 @@
2727
"type":"string"
2828
},
2929
"per_page": {
30-
"description":"Results per page (max 50). Keep constant across paginated requests; changing mid-sequence can complicate page traversal.",
30+
"description":"Results per page (max 50)",
3131
"type":"number"
3232
},
3333
"query": {

‎pkg/github/instructions.go‎

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,42 +65,60 @@ Use 'list_discussion_categories' to understand available categories before creat
6565
case"projects":
6666
return`## Projects
6767
68-
When using 'list_project_items', follow these guidelines:
69-
70-
Field usage:
68+
Read Tools:
69+
- list_projects
70+
- get_project
71+
- list_project_fields
72+
- get_project_field
73+
- list_project_items
74+
- get_project_item
75+
Write Tools:
76+
- add_project_item
77+
- update_project_item
78+
- delete_project_item
79+
80+
Field usage:
7181
- Call list_project_fields first to understand available fields and get IDs/types before filtering.
7282
- Use EXACT returned field names (case-insensitive match). Don't invent names or IDs.
7383
- Iteration synonyms (sprint/cycle/iteration) only if that field exists; map to the actual name (e.g. sprint:@current).
7484
- Only include filters for fields that exist and are relevant.
7585
76-
Pagination (mandatory):
77-
- Loop while pageInfo.hasNextPage=true using after=nextCursor. Keep query, fields, per_page IDENTICAL each page.
78-
79-
Fields parameter:
86+
Pagination (mandatory):
87+
Forward (normal) flow:
88+
- Loop while pageInfo.hasNextPage=true using after=pageInfo.nextCursor.
89+
- Keep query, fields, per_page IDENTICAL on every page.
90+
Backward (rare) flow:
91+
- Use before=pageInfo.prevCursor only when explicitly navigating to a previous page.
92+
Parameters:
93+
- per_page: results per page (max 50). Choose a stable value; do not change mid-sequence.
94+
- after: forward cursor from prior response (pageInfo.nextCursor).
95+
- before: backward cursor from prior response (pageInfo.prevCursor); seldom needed.
96+
97+
Fields parameter:
8098
- Include field IDs on EVERY paginated list_project_items call if you need values. Omit → title only.
8199
82-
Counting rules:
100+
Counting rules:
83101
- Count items array length after full pagination.
84102
- If multi-page: collect all pages, dedupe by item.id (fallback node_id) before totals.
85103
- Never count field objects, content, or nested arrays as separate items.
86104
- item.id = project item ID (for updates/deletes). item.content.id = underlying issue/PR ID.
87105
88-
Summary vs list:
106+
Summary vs list:
89107
- Summaries ONLY if user uses verbs: analyze | summarize | summary | report | overview | insights.
90-
- Listing verbs (list/show/get/fetch/display/enumerate) →justenumerate + total.
108+
- Listing verbs (list/show/get/fetch/display/enumerate) → enumerate + total.
91109
92-
Examples:
110+
Examples:
93111
- list_projects: "roadmap is:open"
94112
- list_project_items: state:open is:issue sprint:@current priority:high updated:>@today-7d
95113
96-
Self-check before returning:
114+
Self-check before returning:
97115
- Paginated fully
98116
- Dedupe by id/node_id
99117
- Correct IDs used
100118
- Field names valid
101119
- Summary only if requested.
102120
103-
Return COMPLETE data or state what's missing (e.g. pages skipped).`
121+
Return COMPLETE data or state what's missing (e.g. pages skipped).`
104122
default:
105123
return""
106124
}

‎pkg/github/projects.go‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ Examples:
5151
- is:open feature planning`),
5252
),
5353
mcp.WithNumber("per_page",
54-
mcp.Description(fmt.Sprintf("Results per page (max %d). Keep constant across paginated requests; changing mid-sequence can complicate page traversal.",MaxProjectsPerPage)),
54+
mcp.Description(fmt.Sprintf("Results per page (max %d)",MaxProjectsPerPage)),
5555
),
5656
mcp.WithString("after",
57-
mcp.Description("Forward pagination cursor. Use when thepreviousresponse'spageInfo.hasNextPage=true. Supply pageInfo.nextCursor as 'after' and immediately request the next page. LOOP UNTIL pageInfo.hasNextPage=false (don't stop early). Keep query and per_page identical for every page."),
57+
mcp.Description("Forward pagination cursor fromprevious pageInfo.nextCursor."),
5858
),
5959
mcp.WithString("before",
60-
mcp.Description("Backward pagination cursor(rare): supply to move to the preceding page usingpageInfo.prevCursor. Not needed for normal forward iteration."),
60+
mcp.Description("Backward pagination cursorfrom previouspageInfo.prevCursor (rare)."),
6161
),
6262
),func(ctx context.Context,req mcp.CallToolRequest) (*mcp.CallToolResult,error) {
6363
owner,err:=RequiredParam[string](req,"owner")
@@ -229,13 +229,13 @@ func ListProjectFields(getClient GetClientFn, t translations.TranslationHelperFu
229229
mcp.Description("The project's number."),
230230
),
231231
mcp.WithNumber("per_page",
232-
mcp.Description(fmt.Sprintf("Results per page (max %d). Keep constant across paginated requests; changing mid-sequence can complicate page traversal.",MaxProjectsPerPage)),
232+
mcp.Description(fmt.Sprintf("Results per page (max %d)",MaxProjectsPerPage)),
233233
),
234234
mcp.WithString("after",
235-
mcp.Description("Forward pagination cursor. Use when thepreviousresponse'spageInfo.hasNextPage=true. Supply pageInfo.nextCursor as 'after' and immediately request the next page. LOOP UNTIL pageInfo.hasNextPage=false (don't stop early). Keep per_page identical for every page."),
235+
mcp.Description("Forward pagination cursor fromprevious pageInfo.nextCursor."),
236236
),
237237
mcp.WithString("before",
238-
mcp.Description("Backward pagination cursor(rare): supply to move to the preceding page usingpageInfo.prevCursor. Not needed for normal forward iteration."),
238+
mcp.Description("Backward pagination cursorfrom previouspageInfo.prevCursor (rare)."),
239239
),
240240
),func(ctx context.Context,req mcp.CallToolRequest) (*mcp.CallToolResult,error) {
241241
owner,err:=RequiredParam[string](req,"owner")
@@ -440,13 +440,13 @@ Never:
440440
- Drop 'fields' param on subsequent pages if field values are needed.`),
441441
),
442442
mcp.WithNumber("per_page",
443-
mcp.Description(fmt.Sprintf("Results per page (max %d). Keep constant across paginated requests; changing mid-sequence can complicate page traversal.",MaxProjectsPerPage)),
443+
mcp.Description(fmt.Sprintf("Results per page (max %d)",MaxProjectsPerPage)),
444444
),
445445
mcp.WithString("after",
446-
mcp.Description("Forward pagination cursor. Use when thepreviousresponse'spageInfo.hasNextPage=true. Supply pageInfo.nextCursor as 'after' and immediately request the next page. LOOP UNTIL pageInfo.hasNextPage=false (don't stop early). Keep query, fields, and per_page identical for every page."),
446+
mcp.Description("Forward pagination cursor fromprevious pageInfo.nextCursor."),
447447
),
448448
mcp.WithString("before",
449-
mcp.Description("Backward pagination cursor(rare): supply to move to the preceding page usingpageInfo.prevCursor. Not needed for normal forward iteration."),
449+
mcp.Description("Backward pagination cursorfrom previouspageInfo.prevCursor (rare)."),
450450
),
451451
mcp.WithArray("fields",
452452
mcp.Description("Field IDs to include (e.g. [\"102589\",\"985201\"]). CRITICAL: Always provide to get field values. Without this, only titles returned. Get IDs from list_project_fields first."),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp