Files
Bryan Zwicker 2198e8599b Add visible fields to project views (#2988)
* Add visible fields to project views

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1421a5d5-fdce-4c0e-9528-56d555ec30d4

* Fail fast and surface orphaned views on project view writes

Reject roadmap layouts before enumerating project fields in both the
create and update paths, and verify view ownership before resolving
visible fields on update, so rejected requests no longer pay for a
paginated field listing.

Skip the follow-up filter mutation when the filter is explicitly null,
since a new view has no filter to clear, and include the created view ID
when cleanup after a failed filter mutation also fails so the caller can
recover the orphaned view.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1421a5d5-fdce-4c0e-9528-56d555ec30d4
2026-08-12 09:40:51 -04:00

281 lines
10 KiB
Plaintext

{
"annotations": {
"destructiveHint": true,
"idempotentHint": false,
"readOnlyHint": false,
"title": "Manage GitHub Projects"
},
"description": "Create and manage GitHub Projects: create projects, add/update/delete items, bulk-update many items at once, manage views, 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"
},
"filter": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Saved view filter; omit on update to preserve it, or pass null to clear it."
},
"issue_number": {
"description": "The issue number. Required for 'add_project_item' when item_type is 'issue'. Also accepted by 'update_project_item' to resolve the item by issue number (combine with item_owner and item_repo).",
"type": "number"
},
"item_id": {
"description": "The project item ID. Required for 'delete_project_item'. For 'update_project_item', provide either item_id, or (item_owner + item_repo + issue_number) to resolve the item by issue.",
"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. Also accepted by 'update_project_item' when resolving the item by issue number.",
"type": "string"
},
"item_repo": {
"description": "The name of the repository containing the issue or pull request. Required for 'add_project_item' method. Also accepted by 'update_project_item' when resolving the item by issue number.",
"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"
},
"items": {
"description": "The items to update with the top-level 'updated_field'. Required for 'update_project_items'; prefer it over calling 'update_project_item' in a loop. Each entry must match exactly one reference variant: 'node_id', numeric 'item_id', or 'item_owner' + 'item_repo' + 'issue_number'. Limit: 50 items per call.",
"items": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"node_id": {
"description": "The project item's GraphQL node ID, as returned by 'list_project_items' or 'add_project_item'.",
"type": "string"
}
},
"required": [
"node_id"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"item_id": {
"description": "The numeric project item ID.",
"type": "integer"
}
},
"required": [
"item_id"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"issue_number": {
"description": "Issue number used to resolve the project item.",
"type": "integer"
},
"item_owner": {
"description": "Owner of the repository containing the issue.",
"type": "string"
},
"item_repo": {
"description": "Repository containing the issue.",
"type": "string"
}
},
"required": [
"item_owner",
"item_repo",
"issue_number"
],
"type": "object"
}
],
"type": "object"
},
"type": "array"
},
"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"
},
"layout": {
"description": "View layout; required when creating a view.",
"enum": [
"table",
"board",
"roadmap"
],
"type": "string"
},
"method": {
"description": "The method to execute",
"enum": [
"add_project_item",
"update_project_item",
"update_project_items",
"delete_project_item",
"create_project_status_update",
"create_project_view",
"update_project_view",
"delete_project_view",
"create_project",
"create_iteration_field"
],
"type": "string"
},
"name": {
"description": "View name; required when creating a view.",
"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": "The field/value to apply, using {\"id\": 123, \"value\": ...} or {\"name\": \"Status\", \"value\": ...}; null clears the field. Required for 'update_project_item' and 'update_project_items', where one top-level field/value applies to every item in a batch. For 'update_project_item' SINGLE_SELECT fields, the name form accepts option names; the ID form expects an option ID.",
"oneOf": [
{
"additionalProperties": false,
"properties": {
"id": {
"description": "The numeric project field ID.",
"type": "integer"
},
"value": {
"description": "The value to apply. Any JSON value is accepted; use null to clear the field."
}
},
"required": [
"id",
"value"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"name": {
"description": "The project field name. Matching is case-insensitive.",
"type": "string"
},
"value": {
"description": "The value to apply. Any JSON value is accepted; use null to clear the field."
}
},
"required": [
"name",
"value"
],
"type": "object"
}
],
"type": "object"
},
"view_id": {
"description": "Project view node ID for update or delete; must belong to owner/project_number.",
"type": "string"
},
"visible_field_names": {
"description": "Ordered project field names to show on create or replace on update; omit on update to preserve, or pass [] to reset. Mutually exclusive with visible_fields. Roadmap accepts only [].",
"items": {
"type": "string"
},
"type": "array"
},
"visible_fields": {
"description": "Ordered project field database IDs to show on create or replace on update; omit on update to preserve, or pass [] to reset. Mutually exclusive with visible_field_names. Roadmap accepts only [].",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"method",
"owner"
],
"type": "object"
},
"name": "projects_write"
}