Trim tool schemas, add param aliases, new PR methods (#191)
- Tool list size reduced by 26.6% (43,032 → 31,599 bytes on the `tools/list` JSON-RPC response). - Trim redundant tool/param descriptions; shared description constants for `owner`/`repo`/`page`/`per_page`. - Schemas now use github-mcp-server param names directly: `issue_number` (was `index` on issue tools), `pull_number` (was `index` on PR tools), `path` (was `filePath`), `query` (was `keyword` on user/repo search), `per_page` (was `perPage`). - New PR read methods `get_files` and `get_status`; new PR write method `update_branch` (update PR branch from base). - `list_org_repos` now uses `per_page` (was `pageSize`). - `milestone_write` accepts `update` and `edit`. - `create_branch` `old_branch` is optional; Gitea defaults to the repo default branch. - Fix `list_commits` handler to honour optional `page`/`per_page` schema (was erroring out when callers omitted them). --- This PR was written with the help of Claude Opus 4.7 Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/191 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-committed-by: silverwind <me@silverwind.io>
This commit is contained in:
+12
-12
@@ -27,24 +27,24 @@ const (
|
||||
var (
|
||||
WikiReadTool = mcp.NewTool(
|
||||
WikiReadToolName,
|
||||
mcp.WithDescription("Read wiki page information. Use method 'list' to list pages, 'get' to get page content, 'get_revisions' for revision history."),
|
||||
mcp.WithDescription("Read wiki: list pages, get content, revision history."),
|
||||
mcp.WithToolAnnotation(annotation.ReadOnly("Read wiki pages")),
|
||||
mcp.WithString("method", mcp.Required(), mcp.Description("operation to perform"), mcp.Enum("list", "get", "get_revisions")),
|
||||
mcp.WithString("owner", mcp.Required(), mcp.Description("repository owner")),
|
||||
mcp.WithString("repo", mcp.Required(), mcp.Description("repository name")),
|
||||
mcp.WithString("pageName", mcp.Description("wiki page name (required for 'get', 'get_revisions')")),
|
||||
mcp.WithString("method", mcp.Required(), mcp.Enum("list", "get", "get_revisions")),
|
||||
mcp.WithString("owner", mcp.Required(), mcp.Description(params.OwnerDesc)),
|
||||
mcp.WithString("repo", mcp.Required(), mcp.Description(params.RepoDesc)),
|
||||
mcp.WithString("pageName", mcp.Description("for 'get'/'get_revisions'")),
|
||||
)
|
||||
|
||||
WikiWriteTool = mcp.NewTool(
|
||||
WikiWriteToolName,
|
||||
mcp.WithDescription("Create, update, or delete wiki pages."),
|
||||
mcp.WithDescription("Write wiki pages: create, update, delete."),
|
||||
mcp.WithToolAnnotation(annotation.Destructive("Create, update, or delete wiki pages")),
|
||||
mcp.WithString("method", mcp.Required(), mcp.Description("operation to perform"), mcp.Enum("create", "update", "delete")),
|
||||
mcp.WithString("owner", mcp.Required(), mcp.Description("repository owner")),
|
||||
mcp.WithString("repo", mcp.Required(), mcp.Description("repository name")),
|
||||
mcp.WithString("pageName", mcp.Description("wiki page name (required for 'update', 'delete')")),
|
||||
mcp.WithString("title", mcp.Description("wiki page title (required for 'create', optional for 'update')")),
|
||||
mcp.WithString("content", mcp.Description("page content (required for 'create', 'update')")),
|
||||
mcp.WithString("method", mcp.Required(), mcp.Enum("create", "update", "delete")),
|
||||
mcp.WithString("owner", mcp.Required(), mcp.Description(params.OwnerDesc)),
|
||||
mcp.WithString("repo", mcp.Required(), mcp.Description(params.RepoDesc)),
|
||||
mcp.WithString("pageName", mcp.Description("for 'update'/'delete'")),
|
||||
mcp.WithString("title", mcp.Description("for 'create'")),
|
||||
mcp.WithString("content", mcp.Description("for 'create'/'update'")),
|
||||
mcp.WithString("message", mcp.Description("commit message")),
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user