-
-
Notifications
You must be signed in to change notification settings - Fork 146
feat: Add MCP tool annotations to all tools #152
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
feat: Add MCP tool annotations to all tools #152
Conversation
Add readOnlyHint, destructiveHint, and title annotations to all 66 tools across 13 workflows to help LLMs better understand tool behavior. Changes: - Update PluginMeta interface to include optional annotations field - Modify tool-registry.ts to pass annotations to SDK registration - Add annotations to all tool definition files: - device (7 tools): build, get_app_path, install, launch, list, stop, test - simulator (12 tools): boot, build, build_run, get_app_path, install, launch, launch_logs, list, open, record, stop, test - simulator-management (5 tools): erase, reset_location, set_appearance, set_location, statusbar - macos (6 tools): build, build_run, get_app_path, launch, stop, test - swift-package (6 tools): build, clean, list, run, stop, test - logging (4 tools): start_device, start_sim, stop_device, stop_sim - ui-testing (11 tools): button, describe_ui, gesture, key_press, key_sequence, long_press, screenshot, swipe, tap, touch, type_text - discovery (1 tool): discover_tools - doctor (1 tool): doctor - project-discovery (5 tools): discover_projs, get_app_bundle_id, get_mac_bundle_id, list_schemes, show_build_settings - project-scaffolding (2 tools): scaffold_ios, scaffold_macos - session-management (3 tools): clear_defaults, set_defaults, show_defaults - utilities (1 tool): clean Annotation guidelines: - readOnlyHint: true for tools that only read/query information - destructiveHint: true for tools that modify state, create/delete files, or execute builds - title: Human-readable name for the tool 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
WalkthroughMetadata annotations were added to the tool infrastructure and individual tool definitions. The Pre-merge checks✅ Passed checks (3 passed)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/mcp/tools/macos/stop_mac_app.ts (1)
49-53: Command injection vulnerability in app name parameter.The shell command directly interpolates
params.appNamewithout sanitisation or escaping, enabling command injection. For example, an app name containingCalculator" && rm -rf / #would execute arbitrary commands.Note: This is pre-existing code, not introduced by this PR.
🔎 Proposed fix: escape shell arguments
} else { // Stop by app name - use shell command with fallback for complex logic + const escapedAppName = params.appName.replace(/'/g, "'\\''"); command = [ 'sh', '-c', - `pkill -f "${params.appName}" || osascript -e 'tell application "${params.appName}" to quit'`, + `pkill -f '${escapedAppName}' || osascript -e 'tell application "${escapedAppName}" to quit'`, ]; }src/utils/tool-registry.ts (1)
156-156: Use .ts extension for internal dynamic import.The dynamic import uses a .js extension for an internal project file, which violates the coding guidelines.
As per coding guidelines, internal imports should use .ts extensions.
🔎 Proposed fix
- const { loadWorkflowGroups } = await import('../core/plugin-registry.js'); + const { loadWorkflowGroups } = await import('../core/plugin-registry.ts');
🧹 Nitpick comments (1)
src/mcp/tools/simulator/get_sim_app_path.ts (1)
196-196: Consider simplifying the redundant ternary.The condition
(simulatorId ? false : useLatestOS)is redundant here. Since you're inside theelse if (simulatorName)block and XOR validation ensuressimulatorIdandsimulatorNameare mutually exclusive,simulatorIdwill always be falsy at this point.🔎 Proposed simplification
- destinationString = `platform=${platform},name=${simulatorName}${(simulatorId ? false : useLatestOS) ? ',OS=latest' : ''}`; + destinationString = `platform=${platform},name=${simulatorName}${useLatestOS ? ',OS=latest' : ''}`;
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (66)
src/core/plugin-types.tssrc/mcp/tools/device/build_device.tssrc/mcp/tools/device/get_device_app_path.tssrc/mcp/tools/device/install_app_device.tssrc/mcp/tools/device/launch_app_device.tssrc/mcp/tools/device/list_devices.tssrc/mcp/tools/device/stop_app_device.tssrc/mcp/tools/device/test_device.tssrc/mcp/tools/discovery/discover_tools.tssrc/mcp/tools/doctor/doctor.tssrc/mcp/tools/logging/start_device_log_cap.tssrc/mcp/tools/logging/start_sim_log_cap.tssrc/mcp/tools/logging/stop_device_log_cap.tssrc/mcp/tools/logging/stop_sim_log_cap.tssrc/mcp/tools/macos/build_macos.tssrc/mcp/tools/macos/build_run_macos.tssrc/mcp/tools/macos/get_mac_app_path.tssrc/mcp/tools/macos/launch_mac_app.tssrc/mcp/tools/macos/stop_mac_app.tssrc/mcp/tools/macos/test_macos.tssrc/mcp/tools/project-discovery/discover_projs.tssrc/mcp/tools/project-discovery/get_app_bundle_id.tssrc/mcp/tools/project-discovery/get_mac_bundle_id.tssrc/mcp/tools/project-discovery/list_schemes.tssrc/mcp/tools/project-discovery/show_build_settings.tssrc/mcp/tools/project-scaffolding/scaffold_ios_project.tssrc/mcp/tools/project-scaffolding/scaffold_macos_project.tssrc/mcp/tools/session-management/session_clear_defaults.tssrc/mcp/tools/session-management/session_set_defaults.tssrc/mcp/tools/session-management/session_show_defaults.tssrc/mcp/tools/simulator-management/erase_sims.tssrc/mcp/tools/simulator-management/reset_sim_location.tssrc/mcp/tools/simulator-management/set_sim_appearance.tssrc/mcp/tools/simulator-management/set_sim_location.tssrc/mcp/tools/simulator-management/sim_statusbar.tssrc/mcp/tools/simulator/boot_sim.tssrc/mcp/tools/simulator/build_run_sim.tssrc/mcp/tools/simulator/build_sim.tssrc/mcp/tools/simulator/get_sim_app_path.tssrc/mcp/tools/simulator/install_app_sim.tssrc/mcp/tools/simulator/launch_app_logs_sim.tssrc/mcp/tools/simulator/launch_app_sim.tssrc/mcp/tools/simulator/list_sims.tssrc/mcp/tools/simulator/open_sim.tssrc/mcp/tools/simulator/record_sim_video.tssrc/mcp/tools/simulator/stop_app_sim.tssrc/mcp/tools/simulator/test_sim.tssrc/mcp/tools/swift-package/swift_package_build.tssrc/mcp/tools/swift-package/swift_package_clean.tssrc/mcp/tools/swift-package/swift_package_list.tssrc/mcp/tools/swift-package/swift_package_run.tssrc/mcp/tools/swift-package/swift_package_stop.tssrc/mcp/tools/swift-package/swift_package_test.tssrc/mcp/tools/ui-testing/button.tssrc/mcp/tools/ui-testing/describe_ui.tssrc/mcp/tools/ui-testing/gesture.tssrc/mcp/tools/ui-testing/key_press.tssrc/mcp/tools/ui-testing/key_sequence.tssrc/mcp/tools/ui-testing/long_press.tssrc/mcp/tools/ui-testing/screenshot.tssrc/mcp/tools/ui-testing/swipe.tssrc/mcp/tools/ui-testing/tap.tssrc/mcp/tools/ui-testing/touch.tssrc/mcp/tools/ui-testing/type_text.tssrc/mcp/tools/utilities/clean.tssrc/utils/tool-registry.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/*.ts: Use .ts extensions for all internal relative imports (e.g., import { tool } from './tool.ts')
Use .ts extensions in re-exports for internal files (e.g., export { default } from '../shared/tool.ts')
Use .js extension only for external package entry points (e.g., import ... from '@scope/pkg/file.js')
Never import internal project files using .js extensions
Files:
src/mcp/tools/device/install_app_device.tssrc/mcp/tools/ui-testing/key_sequence.tssrc/mcp/tools/ui-testing/key_press.tssrc/mcp/tools/simulator/record_sim_video.tssrc/mcp/tools/session-management/session_clear_defaults.tssrc/mcp/tools/macos/build_run_macos.tssrc/mcp/tools/project-scaffolding/scaffold_ios_project.tssrc/mcp/tools/simulator/stop_app_sim.tssrc/mcp/tools/macos/launch_mac_app.tssrc/mcp/tools/discovery/discover_tools.tssrc/mcp/tools/macos/stop_mac_app.tssrc/mcp/tools/simulator/install_app_sim.tssrc/mcp/tools/simulator-management/set_sim_location.tssrc/mcp/tools/simulator/test_sim.tssrc/mcp/tools/device/stop_app_device.tssrc/mcp/tools/project-discovery/list_schemes.tssrc/mcp/tools/swift-package/swift_package_run.tssrc/mcp/tools/session-management/session_set_defaults.tssrc/mcp/tools/simulator/open_sim.tssrc/mcp/tools/swift-package/swift_package_test.tssrc/mcp/tools/ui-testing/describe_ui.tssrc/mcp/tools/ui-testing/touch.tssrc/mcp/tools/macos/test_macos.tssrc/mcp/tools/simulator-management/erase_sims.tssrc/core/plugin-types.tssrc/mcp/tools/simulator/launch_app_sim.tssrc/mcp/tools/ui-testing/type_text.tssrc/mcp/tools/simulator/build_sim.tssrc/mcp/tools/swift-package/swift_package_clean.tssrc/mcp/tools/logging/start_device_log_cap.tssrc/mcp/tools/simulator/get_sim_app_path.tssrc/mcp/tools/utilities/clean.tssrc/mcp/tools/simulator-management/reset_sim_location.tssrc/mcp/tools/logging/stop_sim_log_cap.tssrc/mcp/tools/swift-package/swift_package_stop.tssrc/mcp/tools/device/build_device.tssrc/mcp/tools/ui-testing/gesture.tssrc/mcp/tools/ui-testing/button.tssrc/mcp/tools/device/test_device.tssrc/mcp/tools/project-discovery/get_mac_bundle_id.tssrc/mcp/tools/simulator-management/sim_statusbar.tssrc/mcp/tools/project-discovery/get_app_bundle_id.tssrc/mcp/tools/macos/build_macos.tssrc/mcp/tools/session-management/session_show_defaults.tssrc/mcp/tools/ui-testing/long_press.tssrc/mcp/tools/ui-testing/swipe.tssrc/utils/tool-registry.tssrc/mcp/tools/project-discovery/discover_projs.tssrc/mcp/tools/ui-testing/tap.tssrc/mcp/tools/device/list_devices.tssrc/mcp/tools/ui-testing/screenshot.tssrc/mcp/tools/project-scaffolding/scaffold_macos_project.tssrc/mcp/tools/swift-package/swift_package_build.tssrc/mcp/tools/simulator/build_run_sim.tssrc/mcp/tools/device/launch_app_device.tssrc/mcp/tools/swift-package/swift_package_list.tssrc/mcp/tools/logging/start_sim_log_cap.tssrc/mcp/tools/device/get_device_app_path.tssrc/mcp/tools/simulator-management/set_sim_appearance.tssrc/mcp/tools/simulator/launch_app_logs_sim.tssrc/mcp/tools/macos/get_mac_app_path.tssrc/mcp/tools/simulator/boot_sim.tssrc/mcp/tools/logging/stop_device_log_cap.tssrc/mcp/tools/project-discovery/show_build_settings.tssrc/mcp/tools/simulator/list_sims.tssrc/mcp/tools/doctor/doctor.ts
🔇 Additional comments (68)
src/mcp/tools/ui-testing/swipe.ts (2)
1-23: Imports correctly follow.tsextension guidelines.All internal relative imports use
.tsextensions as required.
133-136: Annotation addition is semantically correct and consistent with the PR pattern.The
destructiveHint: truelabel accurately reflects that swipe modifies simulator UI state, and thetitlefield provides appropriate human-readable metadata. The placement and structure align with the broader 66-tool annotation rollout.Please verify that the
annotationsobject structure conforms to theToolAnnotationstype defined in the updatedPluginMetainterface, and thattool-registry.tscorrectly passes these annotations to the SDK during registration.src/mcp/tools/simulator/launch_app_logs_sim.ts (1)
77-80: LGTM! Annotations correctly reflect tool behaviour.The
destructiveHint: trueannotation is appropriate since this tool launches an app and modifies simulator state. The title clearly describes the tool's purpose.src/mcp/tools/ui-testing/type_text.ts (1)
95-98: LGTM!The annotation correctly classifies
type_textas destructive since it modifies simulator state by typing text into text fields. This aligns with the PR objective of requiring user confirmation for state-modifying operations whilst allowing auto-approval for read-only tools.src/mcp/tools/macos/test_macos.ts (1)
336-339: Verify destructive classification for test operations.The test operation is marked with
destructiveHint: true, which means it will require manual user approval rather than being auto-approved by clients like Claude Code. Whilst tests do execute code and can have side effects, users often consider test operations to be "safe" read-only inspections.Please confirm this classification aligns with your intended user experience, especially given that test runs won't be auto-approved in supporting clients.
src/mcp/tools/simulator/get_sim_app_path.ts (1)
313-316: LGTM! Annotations correctly mark this as read-only.The annotations are appropriate: the tool queries build settings without modifying any state, and the title clearly describes its purpose. This aligns with the PR's goal of enabling auto-approval for read-only operations.
src/mcp/tools/macos/stop_mac_app.ts (1)
85-88: Annotations correctly identify this tool as destructive.The annotations are appropriate: stopping an application is indeed a destructive operation, and the title clearly describes the tool's purpose. This aligns well with the PR's goal of enabling clients to require confirmation for destructive operations.
src/mcp/tools/session-management/session_clear_defaults.ts (1)
36-39: LGTM! Annotation correctly marks this as destructive.The
destructiveHint: trueannotation is appropriate for a tool that clears session state.src/mcp/tools/project-discovery/list_schemes.ts (1)
127-130: LGTM! Annotation correctly marks this as read-only.The
readOnlyHint: trueannotation is appropriate for a tool that queries and lists schemes without modifying state.src/core/plugin-types.ts (2)
9-9: LGTM! Optional field is non-breaking.The optional
annotationsfield extends thePluginMetainterface without breaking existing tool definitions. This allows gradual adoption of the annotations feature.
2-2: No issues found with the import.The import correctly uses the
.jsextension for the external package as per coding guidelines. The@camsoft/mcp-sdk@^1.17.1package exports theToolAnnotationstype, and the import is appropriately used in thePluginMetainterface definition.src/mcp/tools/ui-testing/touch.ts (1)
123-126: LGTM! Annotation correctly marks UI interaction as destructive.The
destructiveHint: trueannotation is appropriate for a tool that performs touch events, as it modifies UI state.src/mcp/tools/macos/build_macos.ts (1)
108-111: LGTM! Annotation correctly marks build operation as destructive.The
destructiveHint: trueannotation is appropriate for a tool that builds apps and generates build artefacts.src/mcp/tools/device/stop_app_device.ts (1)
97-100: LGTM! Annotation correctly marks app termination as destructive.The
destructiveHint: trueannotation is appropriate for a tool that terminates running processes on a device.src/mcp/tools/device/get_device_app_path.ts (1)
164-167: LGTM! Annotation correctly marks path retrieval as read-only.The
readOnlyHint: trueannotation is appropriate for a tool that queries build settings to retrieve the app path without modifying state.src/mcp/tools/device/install_app_device.ts (1)
95-98: LGTM! Annotation correctly marks app installation as destructive.The
destructiveHint: trueannotation is appropriate for a tool that installs apps on devices, as it modifies device state.src/mcp/tools/session-management/session_set_defaults.ts (1)
60-63: LGTM! Annotations are appropriate.The
destructiveHint: truecorrectly indicates that this tool modifies session state. The metadata addition is clean and follows the PR's pattern.src/mcp/tools/simulator/test_sim.ts (1)
138-141: LGTM! Metadata addition is correct.The
destructiveHint: trueis appropriate for a tool that executes tests, as it launches processes and modifies simulator state.src/mcp/tools/macos/build_run_macos.ts (1)
226-229: LGTM! Annotations correctly classify this tool.The
destructiveHint: trueis appropriate for a tool that builds and launches applications, as these are state-changing operations.src/mcp/tools/simulator/install_app_sim.ts (1)
106-109: LGTM! Destructive hint is appropriate.Correctly marks this tool as destructive since installing an app modifies the simulator state.
src/mcp/tools/project-discovery/get_mac_bundle_id.ts (1)
128-131: LGTM! Read-only classification is correct.The
readOnlyHint: trueis appropriate for a tool that only extracts and returns information without modifying state.src/mcp/tools/utilities/clean.ts (1)
166-169: LGTM! Annotations reflect the tool's behaviour.The
destructiveHint: trueis appropriate as cleaning build products removes files from the filesystem.src/mcp/tools/project-scaffolding/scaffold_macos_project.ts (1)
410-413: LGTM! Destructive hint correctly set.The
destructiveHint: trueis appropriate for a tool that creates a new project structure, as it writes files and directories to the filesystem.src/mcp/tools/logging/start_sim_log_cap.ts (1)
71-74: LGTM! Annotations are well-chosen.The
destructiveHint: trueis appropriate as starting log capture launches processes and may relaunch the app to capture console output.src/mcp/tools/macos/get_mac_app_path.ts (1)
198-201: LGTM! Appropriate read-only classification.The annotations correctly classify this tool as read-only since it only retrieves the app bundle path without modifying any state.
src/mcp/tools/device/launch_app_device.ts (1)
154-157: LGTM! Appropriate destructive classification.The annotations correctly classify this tool as destructive since it launches an app on the device, which modifies system state.
src/mcp/tools/device/list_devices.ts (1)
434-437: LGTM! Appropriate read-only classification.The annotations correctly classify this tool as read-only since it only lists connected devices without modifying any state.
src/mcp/tools/ui-testing/tap.ts (1)
189-192: LGTM! Appropriate destructive classification.The annotations correctly classify this tool as destructive since it performs UI interactions that can modify application state.
src/mcp/tools/logging/start_device_log_cap.ts (1)
691-694: LGTM! Appropriate destructive classification.The annotations correctly classify this tool as destructive since it starts a log capture session which launches an app and creates system state.
src/mcp/tools/logging/stop_sim_log_cap.ts (1)
47-50: LGTM! Appropriate destructive classification.The annotations correctly classify this tool as destructive since it stops a log capture session, which modifies system state.
src/mcp/tools/project-discovery/get_app_bundle_id.ts (1)
131-134: LGTM! Appropriate read-only classification.The annotations correctly classify this tool as read-only since it only extracts the bundle identifier from Info.plist without modifying any state.
src/mcp/tools/ui-testing/button.ts (1)
89-92: LGTM! Appropriate destructive classification.The annotations correctly classify this tool as destructive since it presses hardware buttons, which triggers actions and modifies simulator state.
src/mcp/tools/simulator-management/erase_sims.ts (1)
93-96: LGTM! Annotations correctly classify this as a destructive tool.The metadata addition properly identifies the erase operation as destructive, which will enable clients to require user confirmation before execution.
src/mcp/tools/project-scaffolding/scaffold_ios_project.ts (1)
504-507: LGTM! Annotations correctly classify this as a destructive tool.The metadata addition properly identifies the scaffolding operation as destructive since it creates files and directories.
src/mcp/tools/simulator-management/set_sim_appearance.ts (1)
102-105: LGTM! Annotations correctly classify this as a destructive tool.The metadata addition properly identifies the appearance modification operation as destructive.
src/mcp/tools/ui-testing/long_press.ts (1)
122-125: LGTM! Annotations correctly classify this as a destructive tool.The metadata addition properly identifies the long press UI interaction as destructive.
src/mcp/tools/discovery/discover_tools.ts (1)
387-390: LGTM! Annotations correctly classify this as a read-only tool.The metadata addition properly identifies the tool discovery operation as read-only, which will enable clients to auto-approve this tool.
src/mcp/tools/simulator-management/sim_statusbar.ts (1)
104-107: LGTM! Annotations correctly classify this as a destructive tool.The metadata addition properly identifies the status bar modification operation as destructive.
src/mcp/tools/simulator/record_sim_video.ts (1)
233-236: LGTM! Annotations correctly classify this as a destructive tool.The metadata addition properly identifies the video recording operation as destructive.
src/mcp/tools/simulator-management/reset_sim_location.ts (1)
102-105: LGTM! Annotations correctly classify this as a destructive tool.The metadata addition properly identifies the location reset operation as destructive.
src/mcp/tools/swift-package/swift_package_run.ts (1)
226-229: LGTM! Appropriate destructive annotation.The annotation correctly categorises this tool as destructive since it executes Swift packages. The title is clear and consistent with naming conventions.
src/mcp/tools/ui-testing/key_sequence.ts (1)
102-105: LGTM! Correct categorisation for UI automation.The destructive hint is appropriate for a tool that simulates keyboard input, as this modifies the simulator state. The annotation follows the consistent pattern across UI testing tools.
src/mcp/tools/ui-testing/key_press.ts (1)
94-97: LGTM! Consistent with related UI testing tools.The annotation appropriately marks this as destructive since it simulates keyboard input. The categorisation aligns with the related
key_sequencetool.src/mcp/tools/simulator/boot_sim.ts (1)
78-81: LGTM! Appropriate categorisation for state-changing operation.The destructive hint is correct for a tool that boots simulators, as this modifies system state. The annotation is consistent with other simulator management tools in the workflow.
src/mcp/tools/simulator/build_sim.ts (1)
160-163: LGTM! Correct destructive annotation for build operation.The annotation appropriately categorises this as destructive since building creates build artefacts and modifies the file system. The title is clear and consistent with other build tools across workflows.
src/mcp/tools/swift-package/swift_package_list.ts (1)
82-85: LGTM! Correctly categorised as read-only.The read-only hint is appropriate for a tool that lists running processes without modifying state. This properly differentiates it from the destructive
swift_package_runandswift_package_stoptools.src/mcp/tools/simulator/list_sims.ts (1)
220-223: LGTM! Appropriately categorised as read-only.The read-only hint is correct for a tool that queries available simulators without modifying state. This is consistent with other discovery tools like
list_devicesand aligns with the PR's goal of enabling auto-approval for read-only operations.src/mcp/tools/simulator/build_run_sim.ts (1)
513-516: LGTM! Correct destructive categorisation for compound operation.The destructive hint is appropriate since this tool performs multiple state-changing operations (builds, installs, and launches apps). The annotation is consistent with related tools like
build_run_macosand properly reflects the tool's behaviour.src/mcp/tools/simulator/launch_app_sim.ts (1)
210-213: LGTM! Annotations correctly reflect destructive behaviour.The
destructiveHint: trueannotation is appropriate for a tool that launches applications, as this modifies simulator state. The metadata addition aligns with the PR objective of enabling clients to request confirmation for state-changing operations.src/mcp/tools/ui-testing/describe_ui.ts (1)
122-125: LGTM! Annotations correctly identify read-only behaviour.The
readOnlyHint: trueannotation is appropriate as this tool retrieves the accessibility hierarchy without modifying application or simulator state.src/mcp/tools/logging/stop_device_log_cap.ts (1)
315-318: LGTM! Annotations correctly reflect state-modifying behaviour.The
destructiveHint: trueannotation is appropriate as this tool terminates a logging process and removes the session from the active registry.src/mcp/tools/macos/launch_mac_app.ts (1)
82-85: LGTM! Annotations correctly identify destructive operation.The
destructiveHint: trueannotation is appropriate for launching applications, as this modifies system state.src/mcp/tools/session-management/session_show_defaults.ts (1)
8-11: LGTM! Annotations correctly identify read-only behaviour.The
readOnlyHint: trueannotation is appropriate as this tool only retrieves session defaults without modifying state.src/utils/tool-registry.ts (1)
131-131: LGTM! Annotations correctly propagated to SDK registration.The annotations fields are consistently added across all three registration pathways (discovery tools, selected workflows, and static mode), ensuring metadata is available to the MCP SDK.
Also applies to: 169-169, 206-206
src/mcp/tools/simulator/open_sim.ts (1)
74-77: LGTM! Annotations correctly identify destructive operation.The
destructiveHint: trueannotation is appropriate for opening the Simulator application, as this modifies system state.src/mcp/tools/swift-package/swift_package_clean.ts (1)
55-58: LGTM! Annotations correctly identify destructive operation.The
destructiveHint: trueannotation is appropriate as this tool removes build artifacts and derived data.src/mcp/tools/device/test_device.ts (1)
294-297: LGTM!The annotation metadata is appropriate:
destructiveHint: truecorrectly reflects that this tool runs tests (which modify state, create artefacts, and consume resources), and the title 'Test Device' clearly describes the tool's purpose.src/mcp/tools/simulator-management/set_sim_location.ts (1)
130-133: LGTM!The annotation is correctly classified:
destructiveHint: trueappropriately reflects that this tool modifies simulator state by setting a custom GPS location. The title 'Set Simulator Location' clearly describes the operation.src/mcp/tools/swift-package/swift_package_test.ts (1)
93-96: LGTM!The annotation correctly classifies this tool as destructive since running tests modifies the file system (creates build artefacts, coverage data, etc.). The title 'Swift Package Test' accurately describes the tool.
src/mcp/tools/project-discovery/show_build_settings.ts (1)
121-124: LGTM!The annotation is correctly classified:
readOnlyHint: trueappropriately reflects that this tool only reads and displays build settings without modifying project state. The title 'Show Build Settings' clearly describes the operation.src/mcp/tools/doctor/doctor.ts (1)
276-279: LGTM!The annotation is correctly classified:
readOnlyHint: trueappropriately reflects that this diagnostic tool only gathers and displays environment information without modifying system state. The title 'Doctor' is concise and appropriate.src/mcp/tools/swift-package/swift_package_stop.ts (1)
108-111: LGTM!The annotation is correctly classified:
destructiveHint: trueappropriately reflects that this tool modifies system state by terminating a running process. The title 'Swift Package Stop' clearly describes the operation.src/mcp/tools/swift-package/swift_package_build.ts (1)
80-83: LGTM!The annotation is correctly classified:
destructiveHint: trueappropriately reflects that building modifies the file system by creating build artefacts. The title 'Swift Package Build' clearly describes the operation.src/mcp/tools/ui-testing/screenshot.ts (1)
153-156: LGTM!The annotation is correctly classified:
readOnlyHint: trueappropriately reflects that this tool captures the simulator's visual state without modifying the simulator or application state. Although temporary files are created, they are cleaned up immediately and don't represent persistent state changes. The title 'Screenshot' is clear and concise.src/mcp/tools/device/build_device.ts (1)
81-84: LGTM! Appropriate annotation for build tool.The
destructiveHint: trueis correct, as building creates build artifacts and modifies the filesystem. The title is clear and descriptive.src/mcp/tools/simulator/stop_app_sim.ts (1)
164-167: LGTM! Correct classification for state-modifying operation.The
destructiveHint: trueis appropriate, as stopping an application modifies the simulator's runtime state.src/mcp/tools/ui-testing/gesture.ts (1)
166-169: LGTM! Appropriate annotation for UI interaction tool.The
destructiveHint: trueis correct, as performing gestures interacts with and potentially modifies the UI state of the simulator.src/mcp/tools/project-discovery/discover_projs.ts (1)
277-280: LGTM! Correct read-only classification.The
readOnlyHint: trueis appropriate, as this tool only scans and reads the filesystem without making any modifications. This enables auto-approval in compatible clients as intended.
commit: |
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no bugs!
cameroncooke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
Summary
readOnlyHint,destructiveHint,title) to all 66 tools across 13 workflows to help LLMs better understand tool behaviorChanges
Infrastructure:
PluginMetainterface to include optionalannotationsfieldtool-registry.tsto pass annotations to SDK registrationTool Annotations Added:
Test plan
npm run build)npm run lint)npm run typecheck)tools/listresponse🤖 Generated with Claude Code
Note
Introduces MCP tool annotations to improve client UX (e.g., auto-approve read-only tools, confirm destructive actions) and wires them through registration.
annotationstoPluginMeta(usingToolAnnotations) insrc/core/plugin-types.tstool-registry.tsto includeconfig.annotationswhen registering discovery, dynamic (workflow-selected), and static toolsannotationsto tools across workflows (device, simulator, simulator-management, macos, swift-package, logging, ui-testing, discovery, doctor, project-discovery, project-scaffolding, session-management, utilities), setting appropriatetitle,readOnlyHint, ordestructiveHintWritten by Cursor Bugbot for commit 591a57b. This will update automatically on new commits. Configure here.