feat: Add tool annotations for improved LLM tool understanding#40
Merged
cfc4n merged 1 commit intogojue:masterfrom Jan 1, 2026
Merged
Conversation
Add readOnlyHint and destructiveHint annotations to all 22 tools to help LLMs better understand tool behavior and make safer decisions. Changes: - Command tools (1): execute_command marked as destructive - Browser tools (13): navigate, click, fill, etc. marked as destructive; get_callstack marked as read-only - Filesystem tools (8): read/list/search marked as read-only; write/create/move marked as destructive This improves tool safety metadata for MCP clients. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds MCP tool annotations to improve LLM understanding of tool behavior and enable safer tool execution. The annotations include title, readOnlyHint, and destructiveHint fields for all 22 tools across three services.
Key changes:
- Adds human-readable titles to all tools for better UI display
- Classifies tools as either read-only or destructive to guide LLM decision-making
- Enables MCP clients to potentially auto-approve read-only tools without user confirmation
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/services/filesystem/file_system.go | Annotates 8 filesystem tools (5 read-only: read_file, list_directory, search_files, get_file_info, list_allowed_directories; 3 destructive: write_file, create_directory, move_file) |
| pkg/services/command/command.go | Annotates execute_command as destructive with title "Execute Command" |
| pkg/services/browser/browser.go | Annotates 13 browser tools (1 read-only: browser_get_callstack; 12 destructive: navigation, interaction, and debugging tools) |
The annotations are consistently applied and the read-only/destructive classifications are logically correct based on each tool's behavior. No issues were identified in the changes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds MCP tool annotations (
readOnlyHint,destructiveHint,title) to all 22 tools to help LLMs better understand tool behavior and make safer decisions about tool execution.Changes
Command Service (1 tool)
execute_command: Destructive (executes shell commands)Browser Service (13 tools)
browser_navigatebrowser_screenshotbrowser_clickbrowser_fillbrowser_selectbrowser_hoverbrowser_evaluatebrowser_debug_enablebrowser_set_breakpointbrowser_remove_breakpointbrowser_pausebrowser_resumebrowser_get_callstackFilesystem Service (8 tools)
read_filelist_directorysearch_filesget_file_infolist_allowed_directorieswrite_filecreate_directorymove_fileWhy This Matters
Testing
go build ./...passes🤖 Generated with Claude Code