Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: provide tool annotations#308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
williammartin merged 1 commit intomainfromtool-annotations
Apr 23, 2025
Merged

Conversation

SamMorrowDrums
Copy link
Collaborator

@SamMorrowDrumsSamMorrowDrums commentedApr 18, 2025
edited
Loading

Closes:#306

We can provide tool annotations as part of the tool specification. This PR sets the descriptions (with ability to override translations), and theReadOnlyHint.

I tried to make the descriptions more human readable as intended also. These are the translation file entries:

"TOOL_ADD_ISSUE_COMMENT_USER_TITLE":"Add comment to issue","TOOL_ADD_PULL_REQUEST_REVIEW_COMMENT_USER_TITLE":"Add review comment to pull request","TOOL_CREATE_BRANCH_USER_TITLE":"Create branch","TOOL_CREATE_ISSUE_USER_TITLE":"Open new issue","TOOL_CREATE_OR_UPDATE_FILE_USER_TITLE":"Create or update file","TOOL_CREATE_PULL_REQUEST_REVIEW_USER_TITLE":"Submit pull request review","TOOL_CREATE_PULL_REQUEST_USER_TITLE":"Open new pull request","TOOL_CREATE_REPOSITORY_USER_TITLE":"Create repository","TOOL_FORK_REPOSITORY_USER_TITLE":"Fork repository","TOOL_GET_CODE_SCANNING_ALERT_USER_TITLE":"Get Code Scanning alert","TOOL_GET_COMMITS_USER_TITLE":"Get commit details","TOOL_GET_FILE_CONTENTS_USER_TITLE":"Get file or directory contents","TOOL_GET_ISSUE_COMMENTS_USER_TITLE":"Get issue comments","TOOL_GET_ISSUE_USER_TITLE":"Get issue details","TOOL_GET_ME_USER_TITLE":"Fetch my user profile","TOOL_GET_PULL_REQUEST_COMMENTS_USER_TITLE":"Get pull request comments","TOOL_GET_PULL_REQUEST_FILES_USER_TITLE":"Get pull request changed files","TOOL_GET_PULL_REQUEST_REVIEWS_USER_TITLE":"Get pull request reviews","TOOL_GET_PULL_REQUEST_STATUS_USER_TITLE":"Get pull request status","TOOL_GET_PULL_REQUEST_USER_TITLE":"Get pull request details","TOOL_GET_SECRET_SCANNING_ALERT_USER_TITLE":"Get Secret Scanning alert","TOOL_LIST_BRANCHES_USER_TITLE":"List branches","TOOL_LIST_CODE_SCANNING_ALERTS_USER_TITLE":"List code scanning alerts","TOOL_LIST_COMMITS_USER_TITLE":"List commits","TOOL_LIST_ISSUES_USER_TITLE":"List issues","TOOL_LIST_PULL_REQUESTS_USER_TITLE":"List pull requests","TOOL_LIST_SECRET_SCANNING_ALERTS_USER_TITLE":"List secret scanning alerts","TOOL_MERGE_PULL_REQUEST_USER_TITLE":"Merge a pull request","TOOL_PUSH_FILES_USER_TITLE":"Push files to repository","TOOL_SEARCH_CODE_USER_TITLE":"Search code","TOOL_SEARCH_ISSUES_USER_TITLE":"Search issues","TOOL_SEARCH_REPOSITORIES_USER_TITLE":"Search repositories","TOOL_SEARCH_USERS_USER_TITLE":"Search users","TOOL_UPDATE_ISSUE_USER_TITLE":"Edit issue","TOOL_UPDATE_PULL_REQUEST_BRANCH_USER_TITLE":"Update pull request branch","TOOL_UPDATE_PULL_REQUEST_USER_TITLE":"Update pull request"

digitarald reacted with heart emoji
@CopilotCopilotAI review requested due to automatic review settingsApril 18, 2025 04:15
@SamMorrowDrumsSamMorrowDrums requested a review froma team as acode ownerApril 18, 2025 04:15
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

This PR implements tool annotations to enhance the human-readable titles and descriptions for each tool in the GitHub MCP Server. Key changes include updating the mcp-go version in third-party licenses, adding the mcp.WithToolAnnotation field in multiple tool definitions, and refining tool descriptions for clarity.

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

FileDescription
third-party-licenses.*.mdUpdated mcp-go license version to v0.21.1
pkg/toolsets/toolsets.goAdded explicit annotation settings for write/read tools
pkg/github/*.goAdded mcp.WithToolAnnotation to enhance tool specifications
pkg/github/context_tools.goAdded tool annotation for GetMe with a typo in the title
Files not reviewed (1)
  • go.mod: Language not supported

@SamMorrowDrumsSamMorrowDrumsforce-pushed thetool-annotations branch 3 times, most recently from145357a to4e1bd11CompareApril 18, 2025 04:52
Copy link
Collaborator

@williammartinwilliammartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good to me, the only thing that jumps out to me is that the logic for whether something is read-only now lives in two places. It would be my preference to have the toolset registration use the hints here, so that the state is declarative; this will make it easier to use for docs generation.

SamMorrowDrums reacted with heart emoji
Comment on lines +61 to +65
for _, tool := range tools {
if tool.Tool.Annotations.ReadOnlyHint {
panic(fmt.Sprintf("tool (%s) is incorrectly annotated as read-only", tool.Tool.Name))
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think this should probably be tested, but if you're open to it I'd like to flip this and see if we can use theReadOnlyHint declaratively to build the toolsets?

@williammartin
Copy link
Collaborator

Bypassing the "Merging is blocked" since I pushed last because the only thing I did was fix merge conflicts on thego.mod and third party licenses.

@williammartinwilliammartin merged commita58937c intomainApr 23, 2025
16 checks passed
@williammartinwilliammartin deleted the tool-annotations branchApril 23, 2025 11:14
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@williammartinwilliammartinwilliammartin approved these changes

Copilot code reviewCopilotCopilot left review comments

@digitaralddigitaraldAwaiting requested review from digitarald

@tobytobyAwaiting requested review from toby

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Adopt tool annotations fortitle andreadOnlyHint
2 participants
@SamMorrowDrums@williammartin

[8]ページ先頭

©2009-2025 Movatter.jp