chore: destructive by default

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2025-06-16 14:58:49 +02:00
parent 52e0626d94
commit 31dcaf72ae
3 changed files with 7 additions and 6 deletions
@@ -312,7 +312,7 @@ describe('actionsServiceFactory', () => {
},
},
attributes: {
destructive: false,
destructive: true,
idempotent: false,
readOnly: false,
},
@@ -68,8 +68,9 @@ export class DefaultActionsRegistryService implements ActionsRegistryService {
id,
...action,
attributes: {
// todo(blam): what's safe defaults?
destructive: action.attributes?.destructive ?? false,
// Inspired by the @modelcontextprotocol/sdk defaults for the hints.
// https://github.com/modelcontextprotocol/typescript-sdk/blob/dd69efa1de8646bb6b195ff8d5f52e13739f4550/src/types.ts#L777-L812
destructive: action.attributes?.destructive ?? true,
idempotent: action.attributes?.idempotent ?? false,
readOnly: action.attributes?.readOnly ?? false,
},
@@ -220,7 +220,7 @@ describe('actionsRegistryServiceFactory', () => {
{
name: 'test',
attributes: {
destructive: false,
destructive: true,
idempotent: false,
readOnly: false,
},
@@ -243,7 +243,7 @@ describe('actionsRegistryServiceFactory', () => {
title: 'Test',
description: 'Test',
attributes: {
destructive: true,
destructive: false,
idempotent: true,
readOnly: true,
},
@@ -275,7 +275,7 @@ describe('actionsRegistryServiceFactory', () => {
title: 'Test',
description: 'Test',
attributes: {
destructive: true,
destructive: false,
idempotent: true,
readOnly: true,
},