From 2846e179a363904ca66c545cc2f69bcfef57b1c9 Mon Sep 17 00:00:00 2001 From: olaservo Date: Wed, 24 Sep 2025 07:06:31 -0700 Subject: [PATCH] Fix formatting with Prettier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- client/src/App.tsx | 4 ++-- client/src/utils/paramUtils.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 0cca51fc..ad0e1b06 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -779,8 +779,8 @@ const App = () => { try { // Find the tool schema to clean parameters properly - const tool = tools.find(t => t.name === name); - const cleanedParams = tool?.inputSchema + const tool = tools.find((t) => t.name === name); + const cleanedParams = tool?.inputSchema ? cleanParams(params, tool.inputSchema as any) : params; diff --git a/client/src/utils/paramUtils.ts b/client/src/utils/paramUtils.ts index 2a8cfcd9..69a25a3b 100644 --- a/client/src/utils/paramUtils.ts +++ b/client/src/utils/paramUtils.ts @@ -3,14 +3,14 @@ import type { JsonSchemaType } from "./jsonUtils"; /** * Cleans parameters by removing undefined, null, and empty string values for optional fields * while preserving all values for required fields. - * + * * @param params - The parameters object to clean * @param schema - The JSON schema defining which fields are required * @returns Cleaned parameters object with optional empty fields omitted */ export function cleanParams( params: Record, - schema: JsonSchemaType + schema: JsonSchemaType, ): Record { const cleaned: Record = {}; const required = schema.required || []; @@ -39,6 +39,9 @@ export function cleanParams( * @param value - The current value * @returns Whether to set the field to undefined */ -export function shouldSetToUndefined(isRequired: boolean, value: string): boolean { +export function shouldSetToUndefined( + isRequired: boolean, + value: string, +): boolean { return !isRequired && value === ""; }