Skip to content

feat: add MCP tool annotations for read-only vs destructive operations#53

Merged
bobby-smedley merged 4 commits intomainfrom
feat/tool-annotations
Apr 14, 2026
Merged

feat: add MCP tool annotations for read-only vs destructive operations#53
bobby-smedley merged 4 commits intomainfrom
feat/tool-annotations

Conversation

@bobby-smedley
Copy link
Copy Markdown
Contributor

Description of your changes

Add MCP tool annotations (per spec 2025-03-26+) to all 26 CHIP tools declaring whether each operation is read-only or destructive. This enables MCP clients to enforce human-in-the-loop approval for write operations.

Changes:

  • Add Annotations *mcp.ToolAnnotations field to chip.Tool struct, passed through to mcp.Tool at registration
  • Add generic chip.Ptr[T] helper for pointer-to-value conversions (same pattern as k8s.io/utils/ptr.To)
  • 21 read-only tools annotated with ReadOnlyHint: true
  • 5 write tools annotated with DestructiveHint: true

JIRA reference

DEV-169959


Impact Analysis

Low — additive metadata only. No behavioral changes to existing tools. MCP clients that don't support annotations will ignore them.


Checklist

  • I have performed a self-review of my code
  • My code follows the contribution guidelines of this project
  • My changes generate no new warnings

@bobby-smedley bobby-smedley requested a review from a team as a code owner April 13, 2026 16:28
Comment thread pkg/chip/ptr.go
package chip

// Ptr returns a pointer to the given value.
func Ptr[T any](v T) *T { return &v }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe it's time to bump go to 1.26.x, it has solution for that exact problem. Instead of chip.Ptr(true), you could just write new(true).

https://go.dev/doc/go1.26#language

@bobby-smedley bobby-smedley merged commit 6fbf5c8 into main Apr 14, 2026
1 check passed
@bobby-smedley bobby-smedley deleted the feat/tool-annotations branch April 14, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants