Skip to content

feat!: ask for confirmation before running a delete tool - #299

Closed
katayama8000 wants to merge 3 commits into
mainfrom
feat/confirm-before-delete
Closed

katayama8000 wants to merge 3 commits into
mainfrom
feat/confirm-before-delete

Conversation

@katayama8000

Copy link
Copy Markdown
Collaborator

Summary

Before a delete_* tool (delete_issue, delete_version, delete_watching) runs, the server now asks the user to confirm through MCP elicitation. The prompt shows the tool name and its arguments. If the user declines, cancels, or accepts with confirm: false, nothing is deleted and the tool returns an error result.

Only delete is covered: updates stay in Backlog's change history and remove_related_issue can be re-added, but a deleted record cannot be restored.

Breaking change

A client that does not declare elicitation support can no longer run delete_* tools. The call fails with the SDK's capability error instead of deleting.

Implementation

  • withConfirmation returns inputRequired(...), so one handler serves both protocol eras. On 2026-07-28 the client fulfils the request. On 2025-era connections the SDK's legacy shim sends elicitation/create and re-enters the handler with the answer.
  • requiresConfirmation(name) sits next to toolAnnotationsFor and keys off the bare tool name, so --prefix does not affect it.
  • Library consumers that call composeToolHandler directly do not get the confirmation. It is applied in registerTools.

Compared with other servers

  • GitHub's server confirms only delete_repository, by making the user type owner/repo. It also hides the tool from clients without elicitation, and binds the confirmation to the target and a TTL through request state.
  • Linear, Jira (Rovo) and Asana mainly rely on read-only scopes or endpoints and on client-side approval.

Not in this PR

  • Checking that the arguments on the retried call match the ones the user confirmed (binding them into requestState, as GitHub does).
  • A read-only mode.

Testing

  • Unit tests: withConfirmation.test.ts, requiresConfirmation in toolAnnotations.test.ts, and the registration in registerTools.test.ts.
  • Manual check over stdio with a fake 2025-era client:
    • delete_issue sends elicitation/create, and declining returns an error without calling Backlog.
    • add_issue goes straight to the API.
    • A client without the elicitation capability gets an error.

🤖 Generated with Claude Code

katayama8000 and others added 3 commits November 16, 2026 12:17
Built on inputRequired so one handler serves both protocol eras: the SDK's
legacy shim turns it into elicitation/create on 2025-era connections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Updates stay in Backlog's change history and a removed relation can be
re-added, but deleted records cannot be restored. A client without
elicitation support can no longer run delete_* tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@katayama8000

Copy link
Copy Markdown
Collaborator Author

Closing: not pursuing server-side confirmation for now. Over stateless HTTP, 2025-era clients cannot be asked, and the confirmation is not yet bound to the arguments the user saw. Hosts already confirm destructive tools from destructiveHint.

@katayama8000
katayama8000 deleted the feat/confirm-before-delete branch November 16, 2026 05:21
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