feat: Add DestructiveHint to delete_project_item tool annotation#1665
Conversation
Add DestructiveHint: true to the delete_project_item tool to be consistent with other delete operations (delete_file and delete_workflow_run_logs) that properly indicate destructive behavior. This helps LLMs better understand that this tool permanently removes data and should be used with appropriate caution. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds the DestructiveHint: true annotation to the delete_project_item tool to properly indicate its destructive behavior, maintaining consistency with other delete operations in the codebase like delete_file and delete_workflow_run_logs.
Key Changes:
- Added
DestructiveHint: jsonschema.Ptr(true)todelete_project_itemtool annotations - Aligned annotation field formatting for consistency (Title, ReadOnlyHint, DestructiveHint)
| Title: t("TOOL_DELETE_PROJECT_ITEM_USER_TITLE", "Delete project item"), | ||
| ReadOnlyHint: false, | ||
| DestructiveHint: jsonschema.Ptr(true), |
There was a problem hiding this comment.
The toolsnap file for delete_project_item needs to be updated to reflect the addition of DestructiveHint. After making this code change, you need to run UPDATE_TOOLSNAPS=true go test ./... to update the snapshot file at pkg/github/toolsnaps/delete_project_item.snap. The snapshot should include "destructiveHint": true in the annotations object, similar to delete_file.snap and delete_workflow_run_logs.snap. The updated snapshot file must be committed along with this code change.
Add destructiveHint: true to the snapshot file to match the code change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Thanks for the review feedback! I've run The snapshot at |
SamMorrowDrums
left a comment
There was a problem hiding this comment.
Thank you for this, this was a good spot.
Summary
Adds
DestructiveHint: trueannotation to thedelete_project_itemtool to be consistent with other delete operations that properly indicate destructive behavior.Changes
DestructiveHint: jsonschema.Ptr(true)todelete_project_itemtool inpkg/github/projects.goWhy This Matters
The
delete_project_itemtool permanently removes a project item, making it a destructive operation. Other delete tools in the codebase (delete_file,delete_workflow_run_logs) correctly have this annotation set. This ensures LLMs receive consistent semantic metadata about tool behavior:delete_fileReadOnlyHint: false, DestructiveHint: true✅delete_workflow_run_logsReadOnlyHint: false, DestructiveHint: true✅delete_project_itemReadOnlyHint: false❌ → FixedTesting
jsonschema.Ptr(true)pattern as other destructive tools🤖 Generated with Claude Code