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
Browse filesBrowse the repository at this point in the historyBrowse files
committed
feat(governance): add custom properties tools with multi-level scope challenge
Add custom properties support to the non-default governance toolset,
completing the second half of the rulesets + custom properties work
requested in #820.
Rather than porting the original six single-level tools verbatim, this
consolidates them into two level-parameterized tools:
- custom_properties_read (level: repository | organization | enterprise)
- custom_properties_write (level: repository | organization | enterprise)
The `level` argument dispatches to the correct GitHub API. Repository level
reads and writes property VALUES (property_name + value), while organization
and enterprise levels read and write property DEFINITIONS/schema (value_type,
required, allowed_values, default_value, description, values_editable_by).
This distinction is documented in the tool and field descriptions.
Both tools reuse the shared governanceReadScopeAccess/governanceWriteScopeAccess
helpers (renamed from the ruleset-specific names) so rulesets and custom
properties present one consistent, exhaustive scope-challenge policy that
up-scopes based on the requested level.
Co-authored-by: Patrick Knight <patrick-knight@github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1e886867-a922-419a-b02c-ac643716aea8
Copy file name to clipboardExpand all lines: README.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -586,7 +586,7 @@ The following sets of tools are available:
586
586
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/comment-discussion-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/comment-discussion-light.png"><imgsrc="pkg/octicons/icons/comment-discussion-light.png"width="20"height="20"alt="comment-discussion"></picture> |`discussions`| GitHub Discussions related tools |
587
587
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/logo-gist-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/logo-gist-light.png"><imgsrc="pkg/octicons/icons/logo-gist-light.png"width="20"height="20"alt="logo-gist"></picture> |`gists`| GitHub Gist related tools |
588
588
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/git-branch-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/git-branch-light.png"><imgsrc="pkg/octicons/icons/git-branch-light.png"width="20"height="20"alt="git-branch"></picture> |`git`| GitHub Git API related tools for low-level Git operations |
589
-
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/law-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/law-light.png"><imgsrc="pkg/octicons/icons/law-light.png"width="20"height="20"alt="law"></picture> |`governance`| Repository governance tools for managing rulesets at the repository, organization, and enterprise levels |
589
+
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/law-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/law-light.png"><imgsrc="pkg/octicons/icons/law-light.png"width="20"height="20"alt="law"></picture> |`governance`| Repository governance tools for managing rulesets and custom properties at the repository, organization, and enterprise levels |
590
590
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/issue-opened-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/issue-opened-light.png"><imgsrc="pkg/octicons/icons/issue-opened-light.png"width="20"height="20"alt="issue-opened"></picture> |`issues`| GitHub Issues related tools |
591
591
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/tag-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/tag-light.png"><imgsrc="pkg/octicons/icons/tag-light.png"width="20"height="20"alt="tag"></picture> |`labels`| GitHub Labels related tools |
592
592
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="pkg/octicons/icons/bell-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="pkg/octicons/icons/bell-light.png"><imgsrc="pkg/octicons/icons/bell-light.png"width="20"height="20"alt="bell"></picture> |`notifications`| GitHub Notifications related tools |
@@ -892,6 +892,29 @@ The following sets of tools are available:
892
892
-`rules`: An array of rules within the ruleset. Each rule is an object with a 'type' (e.g. 'creation', 'deletion', 'non_fast_forward', 'required_signatures', 'pull_request', 'required_status_checks') and, for rules that need configuration, a 'parameters' object (object[], required)
893
893
-`target`: The target of the ruleset. Defaults to 'branch'. 'repository' is only valid for 'organization' and 'enterprise' level rulesets. (string, optional)
-`enterprise`: Enterprise slug. Required when level is 'enterprise'. (string, optional)
909
+
-`level`: The level at which custom properties are managed:
910
+
- 'repository': The custom property VALUES assigned to a repository (requires 'owner' and 'repo').
911
+
- 'organization': The custom property DEFINITIONS (schema) for an organization (requires 'org').
912
+
- 'enterprise': The custom property DEFINITIONS (schema) for an enterprise (requires 'enterprise'). (string, required)
913
+
-`org`: Organization name. Required when level is 'organization'. (string, optional)
914
+
-`owner`: Repository owner. Required when level is 'repository'. (string, optional)
915
+
-`properties`: The custom properties to create or update. At the repository level each item assigns a value ('property_name' and 'value'); at the organization and enterprise levels each item defines the schema ('property_name' and 'value_type', plus optional definition fields). (object[], required)
916
+
-`repo`: Repository name. Required when level is 'repository'. (string, optional)
Copy file name to clipboardExpand all lines: docs/remote-server.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Below is a table of available toolsets for the remote GitHub MCP Server. Each to
30
30
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="../pkg/octicons/icons/comment-discussion-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="../pkg/octicons/icons/comment-discussion-light.png"><imgsrc="../pkg/octicons/icons/comment-discussion-light.png"width="20"height="20"alt="comment-discussion"></picture><br>`discussions`| GitHub Discussions related tools |https://api.githubcopilot.com/mcp/x/discussions|[Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-discussions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdiscussions%22%7D)|[read-only](https://api.githubcopilot.com/mcp/x/discussions/readonly)|[Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-discussions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdiscussions%2Freadonly%22%7D)|
31
31
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="../pkg/octicons/icons/logo-gist-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="../pkg/octicons/icons/logo-gist-light.png"><imgsrc="../pkg/octicons/icons/logo-gist-light.png"width="20"height="20"alt="logo-gist"></picture><br>`gists`| GitHub Gist related tools |https://api.githubcopilot.com/mcp/x/gists|[Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-gists&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgists%22%7D)|[read-only](https://api.githubcopilot.com/mcp/x/gists/readonly)|[Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-gists&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgists%2Freadonly%22%7D)|
32
32
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="../pkg/octicons/icons/git-branch-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="../pkg/octicons/icons/git-branch-light.png"><imgsrc="../pkg/octicons/icons/git-branch-light.png"width="20"height="20"alt="git-branch"></picture><br>`git`| GitHub Git API related tools for low-level Git operations |https://api.githubcopilot.com/mcp/x/git|[Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-git&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgit%22%7D)|[read-only](https://api.githubcopilot.com/mcp/x/git/readonly)|[Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-git&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgit%2Freadonly%22%7D)|
33
-
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="../pkg/octicons/icons/law-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="../pkg/octicons/icons/law-light.png"><imgsrc="../pkg/octicons/icons/law-light.png"width="20"height="20"alt="law"></picture><br>`governance`| Repository governance tools for managing rulesets at the repository, organization, and enterprise levels |https://api.githubcopilot.com/mcp/x/governance|[Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-governance&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgovernance%22%7D)|[read-only](https://api.githubcopilot.com/mcp/x/governance/readonly)|[Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-governance&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgovernance%2Freadonly%22%7D)|
33
+
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="../pkg/octicons/icons/law-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="../pkg/octicons/icons/law-light.png"><imgsrc="../pkg/octicons/icons/law-light.png"width="20"height="20"alt="law"></picture><br>`governance`| Repository governance tools for managing rulesets and custom properties at the repository, organization, and enterprise levels |https://api.githubcopilot.com/mcp/x/governance|[Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-governance&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgovernance%22%7D)|[read-only](https://api.githubcopilot.com/mcp/x/governance/readonly)|[Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-governance&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgovernance%2Freadonly%22%7D)|
34
34
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="../pkg/octicons/icons/issue-opened-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="../pkg/octicons/icons/issue-opened-light.png"><imgsrc="../pkg/octicons/icons/issue-opened-light.png"width="20"height="20"alt="issue-opened"></picture><br>`issues`| GitHub Issues related tools |https://api.githubcopilot.com/mcp/x/issues|[Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%22%7D)|[read-only](https://api.githubcopilot.com/mcp/x/issues/readonly)|[Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%2Freadonly%22%7D)|
35
35
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="../pkg/octicons/icons/tag-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="../pkg/octicons/icons/tag-light.png"><imgsrc="../pkg/octicons/icons/tag-light.png"width="20"height="20"alt="tag"></picture><br>`labels`| GitHub Labels related tools |https://api.githubcopilot.com/mcp/x/labels|[Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-labels&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Flabels%22%7D)|[read-only](https://api.githubcopilot.com/mcp/x/labels/readonly)|[Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-labels&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Flabels%2Freadonly%22%7D)|
36
36
| <picture><sourcemedia="(prefers-color-scheme: dark)"srcset="../pkg/octicons/icons/bell-dark.png"><sourcemedia="(prefers-color-scheme: light)"srcset="../pkg/octicons/icons/bell-light.png"><imgsrc="../pkg/octicons/icons/bell-light.png"width="20"height="20"alt="bell"></picture><br>`notifications`| GitHub Notifications related tools |https://api.githubcopilot.com/mcp/x/notifications|[Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-notifications&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fnotifications%22%7D)|[read-only](https://api.githubcopilot.com/mcp/x/notifications/readonly)|[Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-notifications&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fnotifications%2Freadonly%22%7D)|
"description": "Read custom properties at the repository, organization, or enterprise level. At the repository level this returns the property values assigned to a repository; at the organization and enterprise levels it returns the property definitions (schema). Select the level with the 'level' parameter.",
8
+
"inputSchema": {
9
+
"properties": {
10
+
"enterprise": {
11
+
"description": "Enterprise slug. Required when level is 'enterprise'.",
12
+
"type": "string"
13
+
},
14
+
"level": {
15
+
"description": "The level at which custom properties are managed:\n- 'repository': The custom property VALUES assigned to a repository (requires 'owner' and 'repo').\n- 'organization': The custom property DEFINITIONS (schema) for an organization (requires 'org').\n- 'enterprise': The custom property DEFINITIONS (schema) for an enterprise (requires 'enterprise').",
16
+
"enum": [
17
+
"repository",
18
+
"organization",
19
+
"enterprise"
20
+
],
21
+
"type": "string"
22
+
},
23
+
"org": {
24
+
"description": "Organization name. Required when level is 'organization'.",
25
+
"type": "string"
26
+
},
27
+
"owner": {
28
+
"description": "Repository owner. Required when level is 'repository'.",
29
+
"type": "string"
30
+
},
31
+
"repo": {
32
+
"description": "Repository name. Required when level is 'repository'.",
"description": "Create or update custom properties at the repository, organization, or enterprise level. At the repository level this sets the property values on a repository (the properties must already be defined for the organization); at the organization and enterprise levels it creates or updates the property definitions (schema). Select the level with the 'level' parameter.",
8
+
"inputSchema": {
9
+
"properties": {
10
+
"enterprise": {
11
+
"description": "Enterprise slug. Required when level is 'enterprise'.",
12
+
"type": "string"
13
+
},
14
+
"level": {
15
+
"description": "The level at which custom properties are managed:\n- 'repository': The custom property VALUES assigned to a repository (requires 'owner' and 'repo').\n- 'organization': The custom property DEFINITIONS (schema) for an organization (requires 'org').\n- 'enterprise': The custom property DEFINITIONS (schema) for an enterprise (requires 'enterprise').",
16
+
"enum": [
17
+
"repository",
18
+
"organization",
19
+
"enterprise"
20
+
],
21
+
"type": "string"
22
+
},
23
+
"org": {
24
+
"description": "Organization name. Required when level is 'organization'.",
25
+
"type": "string"
26
+
},
27
+
"owner": {
28
+
"description": "Repository owner. Required when level is 'repository'.",
29
+
"type": "string"
30
+
},
31
+
"properties": {
32
+
"description": "The custom properties to create or update. At the repository level each item assigns a value ('property_name' and 'value'); at the organization and enterprise levels each item defines the schema ('property_name' and 'value_type', plus optional definition fields).",
33
+
"items": {
34
+
"properties": {
35
+
"allowed_values": {
36
+
"description": "Organization and enterprise levels only: the ordered list of allowed values for single_select and multi_select properties.",
37
+
"items": {
38
+
"type": "string"
39
+
},
40
+
"type": "array"
41
+
},
42
+
"default_value": {
43
+
"description": "Organization and enterprise levels only: the value applied when a repository does not set the property. A string or an array of strings."
44
+
},
45
+
"description": {
46
+
"description": "Organization and enterprise levels only: a short description of the property.",
47
+
"type": "string"
48
+
},
49
+
"property_name": {
50
+
"description": "The name of the custom property.",
51
+
"type": "string"
52
+
},
53
+
"required": {
54
+
"description": "Organization and enterprise levels only: whether the property must be set on every repository.",
55
+
"type": "boolean"
56
+
},
57
+
"value": {
58
+
"description": "Repository level only: the value to assign. A string, an array of strings, or null to clear the value."
59
+
},
60
+
"value_type": {
61
+
"description": "Organization and enterprise levels only: the data type of the property. Required when defining a property.",
62
+
"enum": [
63
+
"string",
64
+
"single_select",
65
+
"multi_select",
66
+
"true_false",
67
+
"url"
68
+
],
69
+
"type": "string"
70
+
},
71
+
"values_editable_by": {
72
+
"description": "Organization and enterprise levels only: who can edit the values of the property.",
73
+
"enum": [
74
+
"org_actors",
75
+
"org_and_repo_actors"
76
+
],
77
+
"type": "string"
78
+
}
79
+
},
80
+
"required": [
81
+
"property_name"
82
+
],
83
+
"type": "object"
84
+
},
85
+
"type": "array"
86
+
},
87
+
"repo": {
88
+
"description": "Repository name. Required when level is 'repository'.",
0 commit comments