-
-
Notifications
You must be signed in to change notification settings - Fork 965
feat(mcp): Add tool annotations for improved LLM tool understanding #2820
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(mcp): Add tool annotations for improved LLM tool understanding #2820
Conversation
Add `readOnlyHint` and `destructiveHint` annotations to all 15 MCP tools to help AI/LLM agents better understand the safety characteristics of each tool: Read-only tools (10): - searchDocsTool - Search documentation - listOrgsTool - List organizations - listProjectsTool - List projects - getCurrentWorker - Get current worker info - listRunsTool - List runs - getRunDetailsTool - Get run details - waitForRunToCompleteTool - Wait for run completion - listDeploysTool - List deployments - listPreviewBranchesTool - List preview branches Destructive tools (5): - createProjectInOrgTool - Creates a new project - initializeProjectTool - Initializes a project - triggerTaskTool - Triggers task execution - cancelRunTool - Cancels a running task - deployTool - Deploys code to environment These annotations follow the MCP specification and help AI agents make informed decisions about which tools require user confirmation before execution. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: daee2f4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 26 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe pull request adds two new metadata fields—readOnlyHint and destructiveHint—to tool definitions across multiple files in the CLI-v3 MCP tools package. These fields are added to tools in deploys.ts, docs.ts, orgs.ts, previewBranches.ts, runs.ts, and tasks.ts, with read-only operations marked as (true, false) and state-mutating operations marked as (false, true). The base tool registration payload in tools.ts is also extended to support these annotation fields. No functional logic, control flow, or error handling is altered. Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (1)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review CompleteYour review story is ready! Comment !reviewfast on this PR to re-generate the story. |
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
Adds MCP tool annotations (
readOnlyHint,destructiveHint) to all 15 tools to help LLMs better understand tool behavior and make safer decisions about tool execution.This is an unsolicited contribution to improve the MCP ecosystem. No existing issue to reference.
✅ Checklist
feat(mcp): ...)Testing
Build verification: TypeScript compiles without errors
Annotation format verification: Confirmed annotations follow MCP specification:
readOnlyHint: truefor read-only tools (queries, fetches, lists)destructiveHint: truefor state-modifying tools (create, deploy, cancel)Live verification pending: Full MCP client integration testing requires environment setup with API credentials
Changelog
Added
readOnlyHint: trueto 10 read-only tools:searchDocsTool,listOrgsTool,listProjectsTool,getCurrentWorkerlistRunsTool,getRunDetailsTool,waitForRunToCompleteToollistDeploysTool,listPreviewBranchesToolAdded
destructiveHint: trueto 5 state-modifying tools:createProjectInOrgTool,initializeProjectTool,triggerTaskToolcancelRunTool,deployToolUpdated
registerTool()intools.tsto pass annotation fieldsWhy This Matters
Screenshots
N/A - metadata-only changes with no UI impact