Skip to content

Commit 6841397

Browse files
Update consolidated projects tools: make owner_type optional and fix add_project_item
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
1 parent 7db8afc commit 6841397

File tree

6 files changed

+397
-113
lines changed

6 files changed

+397
-113
lines changed

pkg/github/__toolsnaps__/projects_get.snap

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,17 @@
66
"description": "Get details about specific GitHub Projects resources.\nUse this tool to get details about individual projects, project fields, and project items by their unique IDs.\n",
77
"inputSchema": {
88
"type": "object",
9-
"required": [
10-
"method",
11-
"owner_type",
12-
"owner",
13-
"project_number"
14-
],
159
"properties": {
1610
"field_id": {
1711
"type": "number",
1812
"description": "The field's ID. Required for 'get_project_field' method."
1913
},
2014
"fields": {
2115
"type": "array",
22-
"description": "Specific list of field IDs to include in the response when getting a project item (e.g. [\"102589\", \"985201\", \"169875\"]). If not provided, only the title field is included. Only used for 'get_project_item' method.",
2316
"items": {
2417
"type": "string"
25-
}
18+
},
19+
"description": "Specific list of field IDs to include in the response when getting a project item (e.g. [\"102589\", \"985201\", \"169875\"]). If not provided, only the title field is included. Only used for 'get_project_item' method."
2620
},
2721
"item_id": {
2822
"type": "number",
@@ -39,11 +33,11 @@
3933
},
4034
"owner": {
4135
"type": "string",
42-
"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."
36+
"description": "The owner (user or organization login). The name is not case sensitive."
4337
},
4438
"owner_type": {
4539
"type": "string",
46-
"description": "Owner type",
40+
"description": "Owner type (user or org). If not provided, will be automatically detected.",
4741
"enum": [
4842
"user",
4943
"org"
@@ -53,7 +47,12 @@
5347
"type": "number",
5448
"description": "The project's number."
5549
}
56-
}
50+
},
51+
"required": [
52+
"method",
53+
"owner",
54+
"project_number"
55+
]
5756
},
5857
"name": "projects_get"
5958
}

pkg/github/__toolsnaps__/projects_list.snap

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
"description": "Tools for listing GitHub Projects resources.\nUse this tool to list projects for a user or organization, or list project fields and items for a specific project.\n",
77
"inputSchema": {
88
"type": "object",
9-
"required": [
10-
"method",
11-
"owner_type",
12-
"owner"
13-
],
149
"properties": {
1510
"after": {
1611
"type": "string",
@@ -22,10 +17,10 @@
2217
},
2318
"fields": {
2419
"type": "array",
25-
"description": "Field IDs to include when listing project items (e.g. [\"102589\", \"985201\"]). CRITICAL: Always provide to get field values. Without this, only titles returned. Only used for 'list_project_items' method.",
2620
"items": {
2721
"type": "string"
28-
}
22+
},
23+
"description": "Field IDs to include when listing project items (e.g. [\"102589\", \"985201\"]). CRITICAL: Always provide to get field values. Without this, only titles returned. Only used for 'list_project_items' method."
2924
},
3025
"method": {
3126
"type": "string",
@@ -38,11 +33,11 @@
3833
},
3934
"owner": {
4035
"type": "string",
41-
"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."
36+
"description": "The owner (user or organization login). The name is not case sensitive."
4237
},
4338
"owner_type": {
4439
"type": "string",
45-
"description": "Owner type",
40+
"description": "Owner type (user or org). If not provided, will automatically try both.",
4641
"enum": [
4742
"user",
4843
"org"
@@ -60,7 +55,11 @@
6055
"type": "string",
6156
"description": "Filter/query string. For list_projects: filter by title text and state (e.g. \"roadmap is:open\"). For list_project_items: advanced filtering using GitHub's project filtering syntax."
6257
}
63-
}
58+
},
59+
"required": [
60+
"method",
61+
"owner"
62+
]
6463
},
6564
"name": "projects_list"
6665
}

pkg/github/__toolsnaps__/projects_write.snap

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,22 @@
66
"description": "Add, update, or delete project items in a GitHub Project.",
77
"inputSchema": {
88
"type": "object",
9-
"required": [
10-
"method",
11-
"owner_type",
12-
"owner",
13-
"project_number"
14-
],
159
"properties": {
10+
"issue_number": {
11+
"type": "number",
12+
"description": "The issue number (use when item_type is 'issue' for 'add_project_item' method). Provide either issue_number or pull_request_number."
13+
},
1614
"item_id": {
1715
"type": "number",
18-
"description": "The project item ID. Required for 'update_project_item' and 'delete_project_item' methods. For add_project_item, this is the numeric ID of the issue or pull request to add."
16+
"description": "The project item ID. Required for 'update_project_item' and 'delete_project_item' methods."
17+
},
18+
"item_owner": {
19+
"type": "string",
20+
"description": "The owner (user or organization) of the repository containing the issue or pull request. Required for 'add_project_item' method."
21+
},
22+
"item_repo": {
23+
"type": "string",
24+
"description": "The name of the repository containing the issue or pull request. Required for 'add_project_item' method."
1925
},
2026
"item_type": {
2127
"type": "string",
@@ -36,11 +42,11 @@
3642
},
3743
"owner": {
3844
"type": "string",
39-
"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."
45+
"description": "The project owner (user or organization login). The name is not case sensitive."
4046
},
4147
"owner_type": {
4248
"type": "string",
43-
"description": "Owner type",
49+
"description": "Owner type (user or org). If not provided, will be automatically detected.",
4450
"enum": [
4551
"user",
4652
"org"
@@ -50,11 +56,20 @@
5056
"type": "number",
5157
"description": "The project's number."
5258
},
59+
"pull_request_number": {
60+
"type": "number",
61+
"description": "The pull request number (use when item_type is 'pull_request' for 'add_project_item' method). Provide either issue_number or pull_request_number."
62+
},
5363
"updated_field": {
5464
"type": "object",
5565
"description": "Object consisting of the ID of the project field to update and the new value for the field. To clear the field, set value to null. Example: {\"id\": 123456, \"value\": \"New Value\"}. Required for 'update_project_item' method."
5666
}
57-
}
67+
},
68+
"required": [
69+
"method",
70+
"owner",
71+
"project_number"
72+
]
5873
},
5974
"name": "projects_write"
6075
}

pkg/github/minimal_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ type MinimalProject struct {
131131
Number *int `json:"number,omitempty"`
132132
ShortDescription *string `json:"short_description,omitempty"`
133133
DeletedBy *MinimalUser `json:"deleted_by,omitempty"`
134+
OwnerType string `json:"owner_type,omitempty"`
134135
}
135136

136137
// Helper functions

0 commit comments

Comments
 (0)