Skip to content

fix(mcp): mark which flight and session tools are destructive - #123

Merged
jlrickert merged 1 commit into
mainfrom
fix/flight-tool-destructive-hints
Oct 7, 2026
Merged

jlrickert merged 1 commit into
mainfrom
fix/flight-tool-destructive-hints

Conversation

@jlrickert

Copy link
Copy Markdown
Owner

Summary

flight_create, flight_edit, flight_delete and session_refresh set readOnlyHint: false but no destructiveHint, so under MCP's default every client reads all four as destructive.

This sets the hint explicitly:

Tool destructiveHint Why
flight_create false creates a new flight; changes nothing existing
session_refresh false retries session activation; changes no data
flight_edit true overwrites a flight's cover and instructions
flight_delete true deletes a flight

A client that approves non-destructive writes on its own (Hub chat's "Approve for me" with a tool on Auto) now runs flight_create and session_refresh without asking, and still asks before flight_edit and flight_delete.

Tests

TestMCP_ToolAnnotations_AllPresent now covers the four tools. go test ./pkg/mcp/ passes.

flight_create, flight_edit, flight_delete and session_refresh set no
destructiveHint, so MCP clients read all four as destructive. Mark
flight_edit and flight_delete destructive, and flight_create and
session_refresh not, so a client that approves non-destructive writes
on its own runs creating a flight or refreshing the session without
asking, and still asks before overwriting or deleting one.
@jlrickert
jlrickert merged commit 0e5d7c0 into main Oct 7, 2026
1 check passed
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.

1 participant