Skip to content

Commit 7894659

Browse files
feat(repos): complete typed repository tool outputs (#3392)
* feat(repos): complete typed repository tool outputs Migrate the remaining 17 repository tools to concrete inputs and outputs. Preserve existing content, mutations, scopes, filtering, and protocol gating; add wire and schema conformance coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * chore(repos): exclude unrelated snapshot formatting drift Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * refactor(repos): compact typed repository outputs Replace raw REST output schemas with compact repository DTOs, retain one canonical snapshot per tool, and align modern JSON text with structured output while pinning legacy content. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 5e737b4 commit 7894659

22 files changed

Lines changed: 3051 additions & 412 deletions

‎README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,12 @@ The following sets of tools are available:
616616

617617
## Tools
618618

619+
Repository tools expose output schemas and typed `structuredContent` to clients using MCP protocol `2026-07-28` or later. Older clients, or clients with an unknown protocol version, receive the existing content without an output schema or structured output.
620+
621+
For `get_file_contents`, directory results (including field projections) are structured arrays. File downloads and metadata-only responses use a `content` array of typed text, embedded-resource, or resource-link blocks, preserving status messages, text, base64 blobs, empty files, and download links. Text-only repository mutations such as starring and deletion also return a structured `message`; fork responses distinguish a repository reference from an in-progress message. Repository deletion still requires its existing confirmation flow before returning a completed result.
622+
623+
Structured repository results use compact DTOs rather than raw REST objects. Release lookups share the compact release shape with release listings; Git references retain the ref, object type, and SHA; annotated tags retain tag/message/tagger/target information; deletion commits retain SHA, message, authors, tree SHA, parent SHAs, and a human-facing `html_url` when available. Directory entries retain file metadata and useful HTML/download links, but omit API and hypermedia routing URLs even when those fields were requested in a projection. Legacy and unknown protocol versions retain the original text byte-for-byte; modern text-only JSON responses serialize the same compact DTO as `structuredContent`. Non-text resource blocks and tool errors retain their existing content behavior. Structured projections use the same sanitized and filtered source as the legacy formatter.
624+
619625
The issue metadata (`list_issue_types`, `list_issue_fields`), comment (`add_issue_comment`, `update_issue_comment`), dependency (`issue_dependency_read`, `issue_dependency_write`), and duplicate-detection (`find_duplicate`) tools provide typed `outputSchema` and `structuredContent` for protocol `2026-07-28` and newer. Older or unknown protocol versions retain the same text responses without these fields. Tool errors do not return structured content. Dependency and duplicate-detection tools retain their existing feature gates.
620626

621627
<!-- START AUTOMATED TOOLS -->

‎pkg/github/__toolsnaps__/create_branch.snap‎

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
"title": "Create branch"
66
},
77
"description": "Create a new branch in a GitHub repository",
8+
"icons": [
9+
{
10+
"mimeType": "image/png",
11+
"src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAABTklEQVRIie2UPUvDUBSGn5PW2qnYwUXExWhNpY2CUKT+BB10E3R0dnbrppuKLgouHbr5X5qlKRIFB+cuguBHj4O05KYfNsVJ+m7n3Hue54ZcrhDKQqGQTX1YVwg7QIbx0gh8b7VTJMMrqS+5RtgD7oDX2GhhC6UcbhkCVLZVuX1sesex4YCdX6uAGgIrsicjlrTGgQ9KVPDnmQgmgongPwgkXNiOq8ADMAtkx4UGvtflJvus20ANeIlN/vW5/kkt8L3D2HD6P9dRgSI8dQcc9w1IR3acBE3vbFSp8ZMVnoFSqJ/unZDe3pAYXyDIJarn9opbDZrewaAh2y7Oy5S1r6h5QG2Xxbw3piDw6xe244oKyxFmC5ihc+tS1qaqngKJyAEBGmZvSGzHVYT790T7aPozsaFoFZGboFGvDJsbOYuOuxuuc7n1uaV8sRSH8Q1DUVLnYLty3gAAAABJRU5ErkJggg==",
12+
"theme": "light"
13+
},
14+
{
15+
"mimeType": "image/png",
16+
"src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAA+ElEQVRIie2WLU5DQRRGzwUEirQCQ9BsoSGtZQHgSFgIsg4JXQCGP8V2QCBIEATZkJDgOJi+MJnMo30TFHmfmzvzfeeKyZ2BROpQvVHfrddDmhkZ4BY4Ai6BD7prAowjIoq7i85nFcGNf6qa1tayM1vAvBZQUg74c/WAHtAD/gMgn6YCT8A2MKwOTaZpCfAF3AGvFdlLx7XqdUVw4186rgWeE8Nn4cU67QLNAS/ASG3qmwVPqdaqjWw9A86BK+CkzaTuAseFBse/AiLiQg1gLzs3Bwb8XIp94AxYL/Af2xordap6v/htHKhv6nTlgBUAh9l6Rx11yfgG8ne/zwh2OysAAAAASUVORK5CYII=",
17+
"theme": "dark"
18+
}
19+
],
820
"inputSchema": {
921
"properties": {
1022
"branch": {
@@ -17,11 +29,13 @@
1729
},
1830
"owner": {
1931
"description": "Repository owner",
20-
"type": "string"
32+
"type": "string",
33+
"x-mcp-header": "owner"
2134
},
2235
"repo": {
2336
"description": "Repository name",
24-
"type": "string"
37+
"type": "string",
38+
"x-mcp-header": "repo"
2539
}
2640
},
2741
"required": [
@@ -31,5 +45,39 @@
3145
],
3246
"type": "object"
3347
},
34-
"name": "create_branch"
48+
"name": "create_branch",
49+
"outputSchema": {
50+
"additionalProperties": false,
51+
"properties": {
52+
"object": {
53+
"additionalProperties": false,
54+
"properties": {
55+
"sha": {
56+
"type": "string"
57+
},
58+
"type": {
59+
"description": "Git object kind: commit, tag, tree, or blob.",
60+
"type": "string"
61+
}
62+
},
63+
"required": [
64+
"type",
65+
"sha"
66+
],
67+
"type": "object"
68+
},
69+
"ref": {
70+
"description": "Fully qualified reference, such as refs/heads/main.",
71+
"type": "string"
72+
}
73+
},
74+
"required": [
75+
"ref",
76+
"object"
77+
],
78+
"type": [
79+
"null",
80+
"object"
81+
]
82+
}
3583
}

‎pkg/github/__toolsnaps__/create_or_update_file.snap‎

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
"title": "Create or update file"
66
},
77
"description": "Create or update a single file in a GitHub repository. \nIf updating, you should provide the SHA of the file you want to update. Use this tool to create or update a file in a GitHub repository remotely; do not use it for local file operations.\n\nTo obtain the current blob SHA before updating, call the get_file_contents tool with the same owner, repo, and path, and set its ref parameter to this tool's branch value. The first text result reports the blob SHA for the requested path.\n\nSHA MUST be provided for existing file updates.\n",
8+
"icons": [
9+
{
10+
"mimeType": "image/png",
11+
"src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAABTklEQVRIie2UPUvDUBSGn5PW2qnYwUXExWhNpY2CUKT+BB10E3R0dnbrppuKLgouHbr5X5qlKRIFB+cuguBHj4O05KYfNsVJ+m7n3Hue54ZcrhDKQqGQTX1YVwg7QIbx0gh8b7VTJMMrqS+5RtgD7oDX2GhhC6UcbhkCVLZVuX1sesex4YCdX6uAGgIrsicjlrTGgQ9KVPDnmQgmgongPwgkXNiOq8ADMAtkx4UGvtflJvus20ANeIlN/vW5/kkt8L3D2HD6P9dRgSI8dQcc9w1IR3acBE3vbFSp8ZMVnoFSqJ/unZDe3pAYXyDIJarn9opbDZrewaAh2y7Oy5S1r6h5QG2Xxbw3piDw6xe244oKyxFmC5ihc+tS1qaqngKJyAEBGmZvSGzHVYT790T7aPozsaFoFZGboFGvDJsbOYuOuxuuc7n1uaV8sRSH8Q1DUVLnYLty3gAAAABJRU5ErkJggg==",
12+
"theme": "light"
13+
},
14+
{
15+
"mimeType": "image/png",
16+
"src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAA+ElEQVRIie2WLU5DQRRGzwUEirQCQ9BsoSGtZQHgSFgIsg4JXQCGP8V2QCBIEATZkJDgOJi+MJnMo30TFHmfmzvzfeeKyZ2BROpQvVHfrddDmhkZ4BY4Ai6BD7prAowjIoq7i85nFcGNf6qa1tayM1vAvBZQUg74c/WAHtAD/gMgn6YCT8A2MKwOTaZpCfAF3AGvFdlLx7XqdUVw4186rgWeE8Nn4cU67QLNAS/ASG3qmwVPqdaqjWw9A86BK+CkzaTuAseFBse/AiLiQg1gLzs3Bwb8XIp94AxYL/Af2xordap6v/htHKhv6nTlgBUAh9l6Rx11yfgG8ne/zwh2OysAAAAASUVORK5CYII=",
17+
"theme": "dark"
18+
}
19+
],
820
"inputSchema": {
921
"properties": {
1022
"allow_symlink_write": {
@@ -26,15 +38,17 @@
2638
},
2739
"owner": {
2840
"description": "Repository owner (username or organization)",
29-
"type": "string"
41+
"type": "string",
42+
"x-mcp-header": "owner"
3043
},
3144
"path": {
3245
"description": "Path where to create/update the file",
3346
"type": "string"
3447
},
3548
"repo": {
3649
"description": "Repository name",
37-
"type": "string"
50+
"type": "string",
51+
"x-mcp-header": "repo"
3852
},
3953
"sha": {
4054
"description": "The blob SHA of the file being replaced. Required if the file already exists. Retrieve it with get_file_contents using the same owner, repo, and path, with ref set to this tool's branch value.",
@@ -51,5 +65,83 @@
5165
],
5266
"type": "object"
5367
},
54-
"name": "create_or_update_file"
68+
"name": "create_or_update_file",
69+
"outputSchema": {
70+
"additionalProperties": false,
71+
"properties": {
72+
"commit": {
73+
"additionalProperties": false,
74+
"properties": {
75+
"author": {
76+
"additionalProperties": false,
77+
"properties": {
78+
"date": {
79+
"type": "string"
80+
},
81+
"email": {
82+
"type": "string"
83+
},
84+
"name": {
85+
"type": "string"
86+
}
87+
},
88+
"type": [
89+
"null",
90+
"object"
91+
]
92+
},
93+
"html_url": {
94+
"type": "string"
95+
},
96+
"message": {
97+
"type": "string"
98+
},
99+
"sha": {
100+
"type": "string"
101+
}
102+
},
103+
"required": [
104+
"sha"
105+
],
106+
"type": [
107+
"null",
108+
"object"
109+
]
110+
},
111+
"content": {
112+
"additionalProperties": false,
113+
"properties": {
114+
"html_url": {
115+
"type": "string"
116+
},
117+
"name": {
118+
"type": "string"
119+
},
120+
"path": {
121+
"type": "string"
122+
},
123+
"sha": {
124+
"type": "string"
125+
},
126+
"size": {
127+
"type": "integer"
128+
}
129+
},
130+
"required": [
131+
"name",
132+
"path",
133+
"sha",
134+
"html_url"
135+
],
136+
"type": [
137+
"null",
138+
"object"
139+
]
140+
}
141+
},
142+
"type": [
143+
"null",
144+
"object"
145+
]
146+
}
55147
}

‎pkg/github/__toolsnaps__/create_repository.snap‎

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
"title": "Create repository"
66
},
77
"description": "Create a new GitHub repository in your account or specified organization",
8+
"icons": [
9+
{
10+
"mimeType": "image/png",
11+
"src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAABTklEQVRIie2UPUvDUBSGn5PW2qnYwUXExWhNpY2CUKT+BB10E3R0dnbrppuKLgouHbr5X5qlKRIFB+cuguBHj4O05KYfNsVJ+m7n3Hue54ZcrhDKQqGQTX1YVwg7QIbx0gh8b7VTJMMrqS+5RtgD7oDX2GhhC6UcbhkCVLZVuX1sesex4YCdX6uAGgIrsicjlrTGgQ9KVPDnmQgmgongPwgkXNiOq8ADMAtkx4UGvtflJvus20ANeIlN/vW5/kkt8L3D2HD6P9dRgSI8dQcc9w1IR3acBE3vbFSp8ZMVnoFSqJ/unZDe3pAYXyDIJarn9opbDZrewaAh2y7Oy5S1r6h5QG2Xxbw3piDw6xe244oKyxFmC5ihc+tS1qaqngKJyAEBGmZvSGzHVYT790T7aPozsaFoFZGboFGvDJsbOYuOuxuuc7n1uaV8sRSH8Q1DUVLnYLty3gAAAABJRU5ErkJggg==",
12+
"theme": "light"
13+
},
14+
{
15+
"mimeType": "image/png",
16+
"src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAA+ElEQVRIie2WLU5DQRRGzwUEirQCQ9BsoSGtZQHgSFgIsg4JXQCGP8V2QCBIEATZkJDgOJi+MJnMo30TFHmfmzvzfeeKyZ2BROpQvVHfrddDmhkZ4BY4Ai6BD7prAowjIoq7i85nFcGNf6qa1tayM1vAvBZQUg74c/WAHtAD/gMgn6YCT8A2MKwOTaZpCfAF3AGvFdlLx7XqdUVw4186rgWeE8Nn4cU67QLNAS/ASG3qmwVPqdaqjWw9A86BK+CkzaTuAseFBse/AiLiQg1gLzs3Bwb8XIp94AxYL/Af2xordap6v/htHKhv6nTlgBUAh9l6Rx11yfgG8ne/zwh2OysAAAAASUVORK5CYII=",
17+
"theme": "dark"
18+
}
19+
],
820
"inputSchema": {
921
"properties": {
1022
"autoInit": {
@@ -34,5 +46,24 @@
3446
],
3547
"type": "object"
3648
},
37-
"name": "create_repository"
49+
"name": "create_repository",
50+
"outputSchema": {
51+
"additionalProperties": false,
52+
"properties": {
53+
"id": {
54+
"type": "string"
55+
},
56+
"url": {
57+
"type": "string"
58+
}
59+
},
60+
"required": [
61+
"id",
62+
"url"
63+
],
64+
"type": [
65+
"null",
66+
"object"
67+
]
68+
}
3869
}

‎pkg/github/__toolsnaps__/delete_file.snap‎

Lines changed: 105 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
"title": "Delete file"
77
},
88
"description": "Delete a file from a GitHub repository",
9+
"icons": [
10+
{
11+
"mimeType": "image/png",
12+
"src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAABTklEQVRIie2UPUvDUBSGn5PW2qnYwUXExWhNpY2CUKT+BB10E3R0dnbrppuKLgouHbr5X5qlKRIFB+cuguBHj4O05KYfNsVJ+m7n3Hue54ZcrhDKQqGQTX1YVwg7QIbx0gh8b7VTJMMrqS+5RtgD7oDX2GhhC6UcbhkCVLZVuX1sesex4YCdX6uAGgIrsicjlrTGgQ9KVPDnmQgmgongPwgkXNiOq8ADMAtkx4UGvtflJvus20ANeIlN/vW5/kkt8L3D2HD6P9dRgSI8dQcc9w1IR3acBE3vbFSp8ZMVnoFSqJ/unZDe3pAYXyDIJarn9opbDZrewaAh2y7Oy5S1r6h5QG2Xxbw3piDw6xe244oKyxFmC5ihc+tS1qaqngKJyAEBGmZvSGzHVYT790T7aPozsaFoFZGboFGvDJsbOYuOuxuuc7n1uaV8sRSH8Q1DUVLnYLty3gAAAABJRU5ErkJggg==",
13+
"theme": "light"
14+
},
15+
{
16+
"mimeType": "image/png",
17+
"src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAA+ElEQVRIie2WLU5DQRRGzwUEirQCQ9BsoSGtZQHgSFgIsg4JXQCGP8V2QCBIEATZkJDgOJi+MJnMo30TFHmfmzvzfeeKyZ2BROpQvVHfrddDmhkZ4BY4Ai6BD7prAowjIoq7i85nFcGNf6qa1tayM1vAvBZQUg74c/WAHtAD/gMgn6YCT8A2MKwOTaZpCfAF3AGvFdlLx7XqdUVw4186rgWeE8Nn4cU67QLNAS/ASG3qmwVPqdaqjWw9A86BK+CkzaTuAseFBse/AiLiQg1gLzs3Bwb8XIp94AxYL/Af2xordap6v/htHKhv6nTlgBUAh9l6Rx11yfgG8ne/zwh2OysAAAAASUVORK5CYII=",
18+
"theme": "dark"
19+
}
20+
],
921
"inputSchema": {
1022
"properties": {
1123
"branch": {
@@ -18,15 +30,17 @@
1830
},
1931
"owner": {
2032
"description": "Repository owner (username or organization)",
21-
"type": "string"
33+
"type": "string",
34+
"x-mcp-header": "owner"
2235
},
2336
"path": {
2437
"description": "Path to the file to delete",
2538
"type": "string"
2639
},
2740
"repo": {
2841
"description": "Repository name",
29-
"type": "string"
42+
"type": "string",
43+
"x-mcp-header": "repo"
3044
}
3145
},
3246
"required": [
@@ -38,5 +52,93 @@
3852
],
3953
"type": "object"
4054
},
41-
"name": "delete_file"
55+
"name": "delete_file",
56+
"outputSchema": {
57+
"additionalProperties": false,
58+
"properties": {
59+
"commit": {
60+
"additionalProperties": false,
61+
"properties": {
62+
"author": {
63+
"additionalProperties": false,
64+
"properties": {
65+
"date": {
66+
"description": "Commit timestamp in RFC3339 format.",
67+
"type": "string"
68+
},
69+
"email": {
70+
"type": "string"
71+
},
72+
"name": {
73+
"type": "string"
74+
}
75+
},
76+
"type": [
77+
"null",
78+
"object"
79+
]
80+
},
81+
"committer": {
82+
"additionalProperties": false,
83+
"properties": {
84+
"date": {
85+
"description": "Commit timestamp in RFC3339 format.",
86+
"type": "string"
87+
},
88+
"email": {
89+
"type": "string"
90+
},
91+
"name": {
92+
"type": "string"
93+
}
94+
},
95+
"type": [
96+
"null",
97+
"object"
98+
]
99+
},
100+
"html_url": {
101+
"type": "string"
102+
},
103+
"message": {
104+
"type": "string"
105+
},
106+
"parents": {
107+
"description": "Parent commit SHAs in Git parent order.",
108+
"items": {
109+
"type": "string"
110+
},
111+
"type": [
112+
"null",
113+
"array"
114+
]
115+
},
116+
"sha": {
117+
"type": "string"
118+
},
119+
"tree_sha": {
120+
"type": "string"
121+
}
122+
},
123+
"required": [
124+
"sha"
125+
],
126+
"type": [
127+
"null",
128+
"object"
129+
]
130+
},
131+
"content": {
132+
"type": "null"
133+
}
134+
},
135+
"required": [
136+
"commit",
137+
"content"
138+
],
139+
"type": [
140+
"null",
141+
"object"
142+
]
143+
}
42144
}

0 commit comments

Comments
 (0)