5d47ccc32f
Adds two new methods to the consolidated projects_write tool: - create_project: creates a new GitHub ProjectsV2 for a user or org - create_iteration_field: adds an iteration field to an existing project Changes addressing review feedback: - Validate owner_type is exactly 'user' or 'org' in create_project - Use resolveProjectNodeID (GraphQL) instead of getProjectNodeID (REST) to avoid HTTP response body leaks - Add omitempty to Iterations JSON tag - Rename iterations item field startDate to start_date for consistency - Validate iteration elements instead of silently skipping invalid ones - Use explicit response structs with snake_case JSON tags - Add test for auto-detected owner_type in create_iteration_field - Use stubExporters() in test deps for nil-safety Co-authored-by: João Doria de Souza <jdoria@github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
139 lines
5.2 KiB
Plaintext
139 lines
5.2 KiB
Plaintext
{
|
|
"annotations": {
|
|
"destructiveHint": true,
|
|
"title": "Manage GitHub Projects"
|
|
},
|
|
"description": "Create and manage GitHub Projects: create projects, add/update/delete items, create status updates, and add iteration fields.",
|
|
"inputSchema": {
|
|
"properties": {
|
|
"body": {
|
|
"description": "The body of the status update (markdown). Used for 'create_project_status_update' method.",
|
|
"type": "string"
|
|
},
|
|
"field_name": {
|
|
"description": "The name of the iteration field (e.g. 'Sprint'). Required for 'create_iteration_field' method.",
|
|
"type": "string"
|
|
},
|
|
"issue_number": {
|
|
"description": "The issue number (use when item_type is 'issue' for 'add_project_item' method). Provide either issue_number or pull_request_number.",
|
|
"type": "number"
|
|
},
|
|
"item_id": {
|
|
"description": "The project item ID. Required for 'update_project_item' and 'delete_project_item' methods.",
|
|
"type": "number"
|
|
},
|
|
"item_owner": {
|
|
"description": "The owner (user or organization) of the repository containing the issue or pull request. Required for 'add_project_item' method.",
|
|
"type": "string"
|
|
},
|
|
"item_repo": {
|
|
"description": "The name of the repository containing the issue or pull request. Required for 'add_project_item' method.",
|
|
"type": "string"
|
|
},
|
|
"item_type": {
|
|
"description": "The item's type, either issue or pull_request. Required for 'add_project_item' method.",
|
|
"enum": [
|
|
"issue",
|
|
"pull_request"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"iteration_duration": {
|
|
"description": "Duration in days for iterations of the field (e.g. 7 for weekly, 14 for bi-weekly). Required for 'create_iteration_field' method.",
|
|
"type": "number"
|
|
},
|
|
"iterations": {
|
|
"description": "Custom iterations for 'create_iteration_field' method. Only set this when you need iterations with varying durations, breaks between them, or specific titles. Otherwise omit it: GitHub auto-creates three iterations of 'iteration_duration' days starting on 'start_date', which is the right choice for most cases.",
|
|
"items": {
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"duration": {
|
|
"description": "Duration in days",
|
|
"type": "number"
|
|
},
|
|
"start_date": {
|
|
"description": "Start date in YYYY-MM-DD format",
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"description": "Iteration title (e.g. 'Sprint 1')",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"title",
|
|
"start_date",
|
|
"duration"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"type": "array"
|
|
},
|
|
"method": {
|
|
"description": "The method to execute",
|
|
"enum": [
|
|
"add_project_item",
|
|
"update_project_item",
|
|
"delete_project_item",
|
|
"create_project_status_update",
|
|
"create_project",
|
|
"create_iteration_field"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"owner": {
|
|
"description": "The project owner (user or organization login). The name is not case sensitive.",
|
|
"type": "string"
|
|
},
|
|
"owner_type": {
|
|
"description": "Owner type (user or org). Required for 'create_project' method. If not provided for other methods, will be automatically detected.",
|
|
"enum": [
|
|
"user",
|
|
"org"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"project_number": {
|
|
"description": "The project's number. Required for all methods except 'create_project'.",
|
|
"type": "number"
|
|
},
|
|
"pull_request_number": {
|
|
"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.",
|
|
"type": "number"
|
|
},
|
|
"start_date": {
|
|
"description": "Start date in YYYY-MM-DD format. Used for 'create_project_status_update' and 'create_iteration_field' methods.",
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"description": "The status of the project. Used for 'create_project_status_update' method.",
|
|
"enum": [
|
|
"INACTIVE",
|
|
"ON_TRACK",
|
|
"AT_RISK",
|
|
"OFF_TRACK",
|
|
"COMPLETE"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"target_date": {
|
|
"description": "The target date of the status update in YYYY-MM-DD format. Used for 'create_project_status_update' method.",
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"description": "The project title. Required for 'create_project' method.",
|
|
"type": "string"
|
|
},
|
|
"updated_field": {
|
|
"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.",
|
|
"type": "object"
|
|
}
|
|
},
|
|
"required": [
|
|
"method",
|
|
"owner"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"name": "projects_write"
|
|
} |