Skip to content

Commit ac89626

Browse files
committed
consolidating repos tools
1 parent c019595 commit ac89626

15 files changed

+1123
-2250
lines changed

README.md

Lines changed: 22 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -983,101 +983,65 @@ Possible options:
983983

984984
<summary>Repositories</summary>
985985

986+
- **commit_read** - Read commits
987+
- `author`: For 'list' method: Author username or email address to filter commits by (string, optional)
988+
- `include_diff`: For 'get' method: Whether to include file diffs and stats in the response. Default is true. (boolean, optional)
989+
- `method`: Method to use: 'get' for getting a single commit, 'list' for listing commits (string, required)
990+
- `owner`: Repository owner (string, required)
991+
- `page`: Page number for pagination (min 1) (number, optional)
992+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
993+
- `repo`: Repository name (string, required)
994+
- `sha`: For 'get': Commit SHA, branch name, or tag name (required). For 'list': Commit SHA, branch or tag name to list commits of (optional). (string, optional)
995+
986996
- **create_branch** - Create branch
987997
- `branch`: Name for new branch (string, required)
988998
- `from_branch`: Source branch (defaults to repo default) (string, optional)
989999
- `owner`: Repository owner (string, required)
9901000
- `repo`: Repository name (string, required)
9911001

992-
- **create_or_update_file** - Create or update file
993-
- `branch`: Branch to create/update the file in (string, required)
994-
- `content`: Content of the file (string, required)
995-
- `message`: Commit message (string, required)
996-
- `owner`: Repository owner (username or organization) (string, required)
997-
- `path`: Path where to create/update the file (string, required)
998-
- `repo`: Repository name (string, required)
999-
- `sha`: Required if updating an existing file. The blob SHA of the file being replaced. (string, optional)
1000-
10011002
- **create_repository** - Create repository
10021003
- `autoInit`: Initialize with README (boolean, optional)
10031004
- `description`: Repository description (string, optional)
10041005
- `name`: Repository name (string, required)
10051006
- `organization`: Organization to create the repository in (omit to create in your personal account) (string, optional)
10061007
- `private`: Whether repo should be private (boolean, optional)
10071008

1008-
- **delete_file** - Delete file
1009-
- `branch`: Branch to delete the file from (string, required)
1009+
- **file_write** - Write operations (create, update, delete, push_files) on repository files
1010+
- `branch`: Branch to perform the operation on (string, required)
1011+
- `content`: Content of the file (required for create and update methods) (string, optional)
1012+
- `files`: Array of file objects to push (required for push_files method), each object with path (string) and content (string) (object[], optional)
10101013
- `message`: Commit message (string, required)
1014+
- `method`: The write operation to perform on repository files. (string, required)
10111015
- `owner`: Repository owner (username or organization) (string, required)
1012-
- `path`: Path to the file to delete (string, required)
1016+
- `path`: Path to the file (required for create, update, delete methods) (string, optional)
10131017
- `repo`: Repository name (string, required)
1018+
- `sha`: Blob SHA of the file being replaced (required for update method) (string, optional)
10141019

10151020
- **fork_repository** - Fork repository
10161021
- `organization`: Organization to fork to (string, optional)
10171022
- `owner`: Repository owner (string, required)
10181023
- `repo`: Repository name (string, required)
10191024

1020-
- **get_commit** - Get commit details
1021-
- `include_diff`: Whether to include file diffs and stats in the response. Default is true. (boolean, optional)
1022-
- `owner`: Repository owner (string, required)
1023-
- `page`: Page number for pagination (min 1) (number, optional)
1024-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
1025-
- `repo`: Repository name (string, required)
1026-
- `sha`: Commit SHA, branch name, or tag name (string, required)
1027-
10281025
- **get_file_contents** - Get file or directory contents
10291026
- `owner`: Repository owner (username or organization) (string, required)
10301027
- `path`: Path to file/directory (directories must end with a slash '/') (string, optional)
10311028
- `ref`: Accepts optional git refs such as `refs/tags/{tag}`, `refs/heads/{branch}` or `refs/pull/{pr_number}/head` (string, optional)
10321029
- `repo`: Repository name (string, required)
10331030
- `sha`: Accepts optional commit SHA. If specified, it will be used instead of ref (string, optional)
10341031

1035-
- **get_latest_release** - Get latest release
1036-
- `owner`: Repository owner (string, required)
1037-
- `repo`: Repository name (string, required)
1038-
1039-
- **get_release_by_tag** - Get a release by tag name
1040-
- `owner`: Repository owner (string, required)
1041-
- `repo`: Repository name (string, required)
1042-
- `tag`: Tag name (e.g., 'v1.0.0') (string, required)
1043-
1044-
- **get_tag** - Get tag details
1045-
- `owner`: Repository owner (string, required)
1046-
- `repo`: Repository name (string, required)
1047-
- `tag`: Tag name (string, required)
1048-
10491032
- **list_branches** - List branches
10501033
- `owner`: Repository owner (string, required)
10511034
- `page`: Page number for pagination (min 1) (number, optional)
10521035
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
10531036
- `repo`: Repository name (string, required)
10541037

1055-
- **list_commits** - List commits
1056-
- `author`: Author username or email address to filter commits by (string, optional)
1057-
- `owner`: Repository owner (string, required)
1058-
- `page`: Page number for pagination (min 1) (number, optional)
1059-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
1060-
- `repo`: Repository name (string, required)
1061-
- `sha`: Commit SHA, branch or tag name to list commits of. If not provided, uses the default branch of the repository. If a commit SHA is provided, will list commits up to that SHA. (string, optional)
1062-
1063-
- **list_releases** - List releases
1064-
- `owner`: Repository owner (string, required)
1065-
- `page`: Page number for pagination (min 1) (number, optional)
1066-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
1067-
- `repo`: Repository name (string, required)
1068-
1069-
- **list_tags** - List tags
1070-
- `owner`: Repository owner (string, required)
1071-
- `page`: Page number for pagination (min 1) (number, optional)
1072-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
1073-
- `repo`: Repository name (string, required)
1074-
1075-
- **push_files** - Push files to repository
1076-
- `branch`: Branch to push to (string, required)
1077-
- `files`: Array of file objects to push, each object with path (string) and content (string) (object[], required)
1078-
- `message`: Commit message (string, required)
1038+
- **release_read** - Read operations for releases and tags
1039+
- `method`: The read operation to perform on releases/tags. (string, required)
10791040
- `owner`: Repository owner (string, required)
1041+
- `page`: Page number for pagination (min 1) (for list_tags and list_releases methods) (number, optional)
1042+
- `perPage`: Results per page for pagination (min 1, max 100) (for list_tags and list_releases methods) (number, optional)
10801043
- `repo`: Repository name (string, required)
1044+
- `tag`: Tag name (required for get_tag and get_release_by_tag methods) (string, optional)
10811045

10821046
- **search_code** - Search code
10831047
- `order`: Sort order for results (string, optional)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"annotations": {
3+
"title": "Read commits",
4+
"readOnlyHint": true
5+
},
6+
"description": "Read commit data from a GitHub repository. Supports getting a single commit or listing commits.",
7+
"inputSchema": {
8+
"properties": {
9+
"author": {
10+
"description": "For 'list' method: Author username or email address to filter commits by",
11+
"type": "string"
12+
},
13+
"include_diff": {
14+
"default": true,
15+
"description": "For 'get' method: Whether to include file diffs and stats in the response. Default is true.",
16+
"type": "boolean"
17+
},
18+
"method": {
19+
"description": "Method to use: 'get' for getting a single commit, 'list' for listing commits",
20+
"enum": [
21+
"get",
22+
"list"
23+
],
24+
"type": "string"
25+
},
26+
"owner": {
27+
"description": "Repository owner",
28+
"type": "string"
29+
},
30+
"page": {
31+
"description": "Page number for pagination (min 1)",
32+
"minimum": 1,
33+
"type": "number"
34+
},
35+
"perPage": {
36+
"description": "Results per page for pagination (min 1, max 100)",
37+
"maximum": 100,
38+
"minimum": 1,
39+
"type": "number"
40+
},
41+
"repo": {
42+
"description": "Repository name",
43+
"type": "string"
44+
},
45+
"sha": {
46+
"description": "For 'get': Commit SHA, branch name, or tag name (required). For 'list': Commit SHA, branch or tag name to list commits of (optional).",
47+
"type": "string"
48+
}
49+
},
50+
"required": [
51+
"method",
52+
"owner",
53+
"repo"
54+
],
55+
"type": "object"
56+
},
57+
"name": "commit_read"
58+
}

pkg/github/__toolsnaps__/create_or_update_file.snap

Lines changed: 0 additions & 49 deletions
This file was deleted.

pkg/github/__toolsnaps__/delete_file.snap

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"annotations": {
3+
"title": "Write operations (create, update, delete, push_files) on repository files",
4+
"readOnlyHint": false
5+
},
6+
"description": "Write operations (create, update, delete, push_files) on repository files.\n\nAvailable methods:\n- create: Create a new file in a repository.\n- update: Update an existing file in a repository. Requires the SHA of the file being replaced.\n- delete: Delete a file from a repository.\n- push_files: Push multiple files to a repository in a single commit.\n",
7+
"inputSchema": {
8+
"properties": {
9+
"branch": {
10+
"description": "Branch to perform the operation on",
11+
"type": "string"
12+
},
13+
"content": {
14+
"description": "Content of the file (required for create and update methods)",
15+
"type": "string"
16+
},
17+
"files": {
18+
"description": "Array of file objects to push (required for push_files method), each object with path (string) and content (string)",
19+
"items": {
20+
"additionalProperties": false,
21+
"properties": {
22+
"content": {
23+
"description": "file content",
24+
"type": "string"
25+
},
26+
"path": {
27+
"description": "path to the file",
28+
"type": "string"
29+
}
30+
},
31+
"required": [
32+
"path",
33+
"content"
34+
],
35+
"type": "object"
36+
},
37+
"type": "array"
38+
},
39+
"message": {
40+
"description": "Commit message",
41+
"type": "string"
42+
},
43+
"method": {
44+
"description": "The write operation to perform on repository files.",
45+
"enum": [
46+
"create",
47+
"update",
48+
"delete",
49+
"push_files"
50+
],
51+
"type": "string"
52+
},
53+
"owner": {
54+
"description": "Repository owner (username or organization)",
55+
"type": "string"
56+
},
57+
"path": {
58+
"description": "Path to the file (required for create, update, delete methods)",
59+
"type": "string"
60+
},
61+
"repo": {
62+
"description": "Repository name",
63+
"type": "string"
64+
},
65+
"sha": {
66+
"description": "Blob SHA of the file being replaced (required for update method)",
67+
"type": "string"
68+
}
69+
},
70+
"required": [
71+
"method",
72+
"owner",
73+
"repo",
74+
"branch",
75+
"message"
76+
],
77+
"type": "object"
78+
},
79+
"name": "file_write"
80+
}

0 commit comments

Comments
 (0)