Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new tool to update project items for users or organizations, addressing issue #44. The implementation follows the existing pattern of project item management tools by adding the UpdateProjectItem function with comprehensive validation and testing.
- Add
UpdateProjectItemtool function with field update capabilities - Implement comprehensive test coverage with error handling scenarios
- Update project item data structures to support additional fields
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/tools.go | Registers the new UpdateProjectItem tool in the write toolset |
| pkg/github/projects.go | Implements UpdateProjectItem function with validation and API call logic |
| pkg/github/projects_test.go | Adds comprehensive test suite covering success and error scenarios |
| pkg/github/minimal_types.go | Extends MinimalProjectItem struct with Title and Description fields |
| pkg/github/toolsnaps/update_project_item.snap | Tool schema snapshot for testing validation |
| README.md | Documents the new update_project_item tool parameters |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…item-tool' into add-update_project_item-tool
…item-tool' into add-update_project_item-tool
c6415d1 to
d835623
Compare
|
I am having a hard time understanding fields array of objects Required id integer Required value null or string or number Required For text, number, and date fields, provide the new value directly. |
| ), | ||
| mcp.WithObject("new_field", | ||
| mcp.Required(), | ||
| mcp.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\"}"), |
There was a problem hiding this comment.
seems like we are looking for a map struct.
Should it look something like this
mcp.Items(
map[string]interface{}{
"type": "string",
},
),
There was a problem hiding this comment.
I am not sure if we can rely on the llm to always understand and format a correct parseable struct
There was a problem hiding this comment.
ah ok i see it needs to be more flexible
mcp.WithObject("new_field",
mcp.Required(),
mcp.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."),
mcp.Properties(map[string]any{
"id": map[string]any{
"type": "number",
"description": "The ID of the project field to update (required)",
},
"value": map[string]any{
"description": "The new value for the field. Can be a string for text fields, a number for number/single_select/iteration fields, or null to clear the field (required)",
},
}),
would something like that help?
There was a problem hiding this comment.
I'd propose we split it into 2 fields which is field_id and field_value
There was a problem hiding this comment.
How the types would look like then? We can use WithNumber for the field_id but field value needs to stay an object
There was a problem hiding this comment.
@almaleksia @JoannaaKL i updated the struct the one before was wrong
…item-tool' into add-update_project_item-tool
ab0ae59 to
f48befc
Compare
|
💯 thanks for making this complicated one work note for future as i dont want to block this merge:
|
* Add update project item tool * Update docs * Add tests and tool snaps * Remove unnecessary comments * Formatting and fixes * Extract error messages to const * Fix json tag * Rename field * Update params * Update test * Update tool example
This pr:
Closes: Add support for Projects #44 (comment)