From 9de2e82b8f9547149d5940dd2c65ea2a6458db3f Mon Sep 17 00:00:00 2001 From: Olcan Date: Sun, 27 Apr 2025 10:25:12 -0700 Subject: don't confirm invalid params in terminal tool, or in general (added comments to base class) (#187) --- packages/server/src/tools/tools.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'packages/server/src/tools/tools.ts') diff --git a/packages/server/src/tools/tools.ts b/packages/server/src/tools/tools.ts index 448ea206..57a388d8 100644 --- a/packages/server/src/tools/tools.ts +++ b/packages/server/src/tools/tools.ts @@ -36,6 +36,8 @@ export interface Tool< /** * Validates the parameters for the tool + * Should be called from both `shouldConfirmExecute` and `execute` + * `shouldConfirmExecute` should return false immediately if invalid * @param params Parameters to validate * @returns An error message string if invalid, null otherwise */ @@ -102,6 +104,8 @@ export abstract class BaseTool< /** * Validates the parameters for the tool * This is a placeholder implementation and should be overridden + * Should be called from both `shouldConfirmExecute` and `execute` + * `shouldConfirmExecute` should return false immediately if invalid * @param params Parameters to validate * @returns An error message string if invalid, null otherwise */ -- cgit v1.2.3