You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/github/__toolsnaps__/get_project_item.snap
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,13 @@
6
6
"description": "Get a specific Project item for a user or org",
7
7
"inputSchema": {
8
8
"properties": {
9
+
"fields": {
10
+
"description": "Specific list of field IDs to include in the response (e.g. [\"102589\", \"985201\", \"169875\"]). If not provided, only the title field is included.",
Copy file name to clipboardExpand all lines: pkg/github/__toolsnaps__/list_project_items.snap
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,13 @@
6
6
"description": "List Project items for a user or org",
7
7
"inputSchema": {
8
8
"properties": {
9
+
"fields": {
10
+
"description": "Specific list of field IDs to include in the response (e.g. [\"102589\", \"985201\", \"169875\"]). If not provided, only the title field is included.",
11
+
"items": {
12
+
"type": "string"
13
+
},
14
+
"type": "array"
15
+
},
9
16
"owner": {
10
17
"description": "If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive.",
@@ -76,7 +76,8 @@ func ListProjects(getClient GetClientFn, t translations.TranslationHelperFunc) (
76
76
projects:= []github.ProjectV2{}
77
77
minimalProjects:= []MinimalProject{}
78
78
79
-
opts:=listProjectsOptions{PerPage: perPage}
79
+
opts:=listProjectsOptions{}
80
+
opts.PerPage=perPage
80
81
81
82
ifqueryStr!="" {
82
83
opts.Query=queryStr
@@ -257,7 +258,9 @@ func ListProjectFields(getClient GetClientFn, t translations.TranslationHelperFu
257
258
}
258
259
projectFields:= []projectV2Field{}
259
260
260
-
opts:=listProjectsOptions{PerPage: perPage}
261
+
opts:=paginationOptions{}
262
+
opts.PerPage=perPage
263
+
261
264
url, err=addOptions(url, opts)
262
265
iferr!=nil {
263
266
returnnil, fmt.Errorf("failed to add options to request: %w", err)
@@ -402,6 +405,10 @@ func ListProjectItems(getClient GetClientFn, t translations.TranslationHelperFun
402
405
mcp.WithNumber("per_page",
403
406
mcp.Description("Number of results per page (max 100, default: 30)"),
404
407
),
408
+
mcp.WithArray("fields",
409
+
mcp.Description("Specific list of field IDs to include in the response (e.g. [\"102589\", \"985201\", \"169875\"]). If not provided, only the title field is included."),
@@ -436,10 +448,17 @@ func ListProjectItems(getClient GetClientFn, t translations.TranslationHelperFun
436
448
}
437
449
projectItems:= []projectV2Item{}
438
450
439
-
opts:=listProjectsOptions{PerPage: perPage}
451
+
opts:=listProjectItemsOptions{}
452
+
opts.PerPage=perPage
453
+
440
454
ifqueryStr!="" {
441
455
opts.Query=queryStr
442
456
}
457
+
458
+
iflen(fields) >0 {
459
+
opts.Fields=fields
460
+
}
461
+
443
462
url, err=addOptions(url, opts)
444
463
iferr!=nil {
445
464
returnnil, fmt.Errorf("failed to add options to request: %w", err)
@@ -504,6 +523,10 @@ func GetProjectItem(getClient GetClientFn, t translations.TranslationHelperFunc)
504
523
mcp.Required(),
505
524
mcp.Description("The item's ID."),
506
525
),
526
+
mcp.WithArray("fields",
527
+
mcp.Description("Specific list of field IDs to include in the response (e.g. [\"102589\", \"985201\", \"169875\"]). If not provided, only the title field is included."),
mcp.WithPromptDescription(t("PROMPT_MANAGE_PROJECT_ITEMS_DESCRIPTION", "Guide for working with GitHub Projects, including listing projects, viewing fields, querying items, and updating field values.")),
1028
+
mcp.WithArgument("owner", mcp.ArgumentDescription("The owner of the project (user or organization name)"), mcp.RequiredArgument()),
1029
+
mcp.WithArgument("owner_type", mcp.ArgumentDescription("Type of owner: 'user' or 'org'"), mcp.RequiredArgument()),
Content: mcp.NewTextContent("You are an assistant helping users work with GitHub Projects (Projects V2). Your role is to help them discover projects, understand project fields, query items, and update field values on project items."),
1038
+
},
1039
+
{
1040
+
Role: "user",
1041
+
Content: mcp.NewTextContent(fmt.Sprintf("I want to work with projects owned by %s (owner_type: %s). Please help me understand what projects are available.", owner, ownerType)),
1042
+
},
1043
+
{
1044
+
Role: "assistant",
1045
+
Content: mcp.NewTextContent(fmt.Sprintf("I'll help you explore the projects for %s. Let me start by listing the available projects.", owner)),
1046
+
},
1047
+
{
1048
+
Role: "user",
1049
+
Content: mcp.NewTextContent("Great! Once you show me the projects, I'd like to understand the fields available in a specific project."),
1050
+
},
1051
+
{
1052
+
Role: "assistant",
1053
+
Content: mcp.NewTextContent("Perfect! After showing you the projects, I can help you:\n\n1. 📋 List all fields in a project (using `list_project_fields`)\n2. 🔍 Get details about specific fields including their IDs, data types, and options\n3. 📊 Query project items with specific field values (using `list_project_items`)\n\nIMPORTANT: When querying project items, you must provide a list of field IDs in the 'fields' parameter to access field values. For example: fields=[\"198354254\", \"198354255\"] to get Status and Assignees. Without this parameter, only the title field is returned."),
1054
+
},
1055
+
{
1056
+
Role: "user",
1057
+
Content: mcp.NewTextContent("How do I update field values on project items?"),
1058
+
},
1059
+
{
1060
+
Role: "assistant",
1061
+
Content: mcp.NewTextContent("To update field values on project items, you'll use the `update_project_item` tool. Here's what you need to know:\n\n1. **Get the item_id**: Use `list_project_items` to find the internal project item ID (not the issue/PR number)\n2. **Get the field_id**: Use `list_project_fields` to find the ID of the field you want to update\n3. **Update the field**: Call `update_project_item` with:\n - project_number: The project's number\n - item_id: The internal project item ID\n - updated_field: An object with {\"id\": <field_id>, \"value\": <new_value>}\n\nFor single_select fields, the value should be the option name (e.g., \"In Progress\").\nFor text fields, provide a string value.\nFor number fields, provide a numeric value.\nTo clear a field, set \"value\" to null."),
1062
+
},
1063
+
{
1064
+
Role: "user",
1065
+
Content: mcp.NewTextContent("Can you give me an example workflow for finding items and updating their status?"),
1066
+
},
1067
+
{
1068
+
Role: "assistant",
1069
+
Content: mcp.NewTextContent(fmt.Sprintf("Absolutely! Here's a complete workflow:\n\n**Step 1: Find your project**\nUse `list_projects` with owner=\"%s\" and owner_type=\"%s\"\n\n**Step 2: Get the Status field ID**\nUse `list_project_fields` with the project_number from step 1\nLook for the field with name=\"Status\" and note its ID (e.g., 198354254)\n\n**Step 3: Query items with the Status field**\nUse `list_project_items` with fields=[\"198354254\"] to see current status values\nOptionally add a query parameter to filter items (e.g., query=\"assignee:@me\")\n\n**Step 4: Update an item's status**\nUse `update_project_item` with:\n- item_id: The ID from the item you want to update\n- updated_field: {\"id\": 198354254, \"value\": \"In Progress\"}\n\nLet me start by listing your projects now.", owner, ownerType)),
0 commit comments