Skip to content

Commit 6c07546

Browse files
CopilotomgitsadsLuluBeatsonCopilot
authored
Migrate gists toolset to modelcontextprotocol/go-sdk (#1431)
* Initial plan * Migrate gists toolset to modelcontextprotocol/go-sdk - Remove //go:build ignore tags from gists.go and gists_test.go - Update imports to use modelcontextprotocol/go-sdk instead of mark3labs/mcp-go - Migrate all 4 tools (ListGists, GetGist, CreateGist, UpdateGist): - Updated tool definitions to use jsonschema.Schema for InputSchema - Changed handler signatures to new SDK format with generics - Updated parameter extraction to use args map instead of request object - Replaced result helpers with utils package equivalents - Updated all tests to match new handler signatures - Added toolsnap tests for all 4 tools - Added parseISOTimestamp utility function to minimal_types.go - Created toolsnaps for all 4 tools Related to #1428 Co-authored-by: omgitsads <[email protected]> * fix invalid schema, re-add gists toolset to server * make schema types lowercase * Don't assert without a testing.T * just return the tool & handler * Add Close method to IOLogger to close underlying reader and writer * Update cmd/github-mcp-server/generate_docs.go Co-authored-by: Copilot <[email protected]> * remove unnecessary translation --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: omgitsads <[email protected]> Co-authored-by: LuluBeatson <[email protected]> Co-authored-by: Adam Holt <[email protected]> Co-authored-by: Adam Holt <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 5ab610c commit 6c07546

File tree

8 files changed

+498
-288
lines changed

8 files changed

+498
-288
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"annotations": {
3+
"title": "Create Gist"
4+
},
5+
"description": "Create a new gist",
6+
"inputSchema": {
7+
"type": "object",
8+
"required": [
9+
"filename",
10+
"content"
11+
],
12+
"properties": {
13+
"content": {
14+
"type": "string",
15+
"description": "Content for simple single-file gist creation"
16+
},
17+
"description": {
18+
"type": "string",
19+
"description": "Description of the gist"
20+
},
21+
"filename": {
22+
"type": "string",
23+
"description": "Filename for simple single-file gist creation"
24+
},
25+
"public": {
26+
"type": "boolean",
27+
"description": "Whether the gist is public",
28+
"default": false
29+
}
30+
}
31+
},
32+
"name": "create_gist"
33+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "Get Gist Content"
5+
},
6+
"description": "Get gist content of a particular gist, by gist ID",
7+
"inputSchema": {
8+
"type": "object",
9+
"required": [
10+
"gist_id"
11+
],
12+
"properties": {
13+
"gist_id": {
14+
"type": "string",
15+
"description": "The ID of the gist"
16+
}
17+
}
18+
},
19+
"name": "get_gist"
20+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "List Gists"
5+
},
6+
"description": "List gists for a user",
7+
"inputSchema": {
8+
"type": "object",
9+
"properties": {
10+
"page": {
11+
"type": "number",
12+
"description": "Page number for pagination (min 1)",
13+
"minimum": 1
14+
},
15+
"perPage": {
16+
"type": "number",
17+
"description": "Results per page for pagination (min 1, max 100)",
18+
"minimum": 1,
19+
"maximum": 100
20+
},
21+
"since": {
22+
"type": "string",
23+
"description": "Only gists updated after this time (ISO 8601 timestamp)"
24+
},
25+
"username": {
26+
"type": "string",
27+
"description": "GitHub username (omit for authenticated user's gists)"
28+
}
29+
}
30+
},
31+
"name": "list_gists"
32+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"annotations": {
3+
"title": "Update Gist"
4+
},
5+
"description": "Update an existing gist",
6+
"inputSchema": {
7+
"type": "object",
8+
"required": [
9+
"gist_id",
10+
"filename",
11+
"content"
12+
],
13+
"properties": {
14+
"content": {
15+
"type": "string",
16+
"description": "Content for the file"
17+
},
18+
"description": {
19+
"type": "string",
20+
"description": "Updated description of the gist"
21+
},
22+
"filename": {
23+
"type": "string",
24+
"description": "Filename to update or create"
25+
},
26+
"gist_id": {
27+
"type": "string",
28+
"description": "ID of the gist to update"
29+
}
30+
}
31+
},
32+
"name": "update_gist"
33+
}

0 commit comments

Comments
 (0)