diff --git a/client/src/components/ToolsTab.tsx b/client/src/components/ToolsTab.tsx index 0123296a..0ef80f77 100644 --- a/client/src/components/ToolsTab.tsx +++ b/client/src/components/ToolsTab.tsx @@ -151,15 +151,39 @@ const ToolsTab = ({ const required = isPropertyRequired(key, inputSchema); return (
- +
+ + {prop.nullable ? ( +
+ + setParams({ + ...params, + [key]: checked ? null : prop.default, + }) + } + /> + +
+ ) : null} +
+ {prop.type === "boolean" ? (
(t as JsonSchemaType).type === "string") && schema.anyOf.some((t) => (t as JsonSchemaType).type === "null") ) { - return { ...schema, type: "string", anyOf: undefined }; + return { ...schema, type: "string", anyOf: undefined, nullable: true }; } // Handle anyOf with exactly boolean and null (FastMCP pattern) @@ -168,7 +168,7 @@ export function normalizeUnionType(schema: JsonSchemaType): JsonSchemaType { schema.anyOf.some((t) => (t as JsonSchemaType).type === "boolean") && schema.anyOf.some((t) => (t as JsonSchemaType).type === "null") ) { - return { ...schema, type: "boolean", anyOf: undefined }; + return { ...schema, type: "boolean", anyOf: undefined, nullable: true }; } // Handle anyOf with exactly number and null (FastMCP pattern) @@ -178,7 +178,7 @@ export function normalizeUnionType(schema: JsonSchemaType): JsonSchemaType { schema.anyOf.some((t) => (t as JsonSchemaType).type === "number") && schema.anyOf.some((t) => (t as JsonSchemaType).type === "null") ) { - return { ...schema, type: "number", anyOf: undefined }; + return { ...schema, type: "number", anyOf: undefined, nullable: true }; } // Handle anyOf with exactly integer and null (FastMCP pattern) @@ -188,7 +188,7 @@ export function normalizeUnionType(schema: JsonSchemaType): JsonSchemaType { schema.anyOf.some((t) => (t as JsonSchemaType).type === "integer") && schema.anyOf.some((t) => (t as JsonSchemaType).type === "null") ) { - return { ...schema, type: "integer", anyOf: undefined }; + return { ...schema, type: "integer", anyOf: undefined, nullable: true }; } // Handle array type with exactly string and null @@ -198,7 +198,7 @@ export function normalizeUnionType(schema: JsonSchemaType): JsonSchemaType { schema.type.includes("string") && schema.type.includes("null") ) { - return { ...schema, type: "string" }; + return { ...schema, type: "string", nullable: true }; } // Handle array type with exactly boolean and null @@ -208,7 +208,7 @@ export function normalizeUnionType(schema: JsonSchemaType): JsonSchemaType { schema.type.includes("boolean") && schema.type.includes("null") ) { - return { ...schema, type: "boolean" }; + return { ...schema, type: "boolean", nullable: true }; } // Handle array type with exactly number and null @@ -218,7 +218,7 @@ export function normalizeUnionType(schema: JsonSchemaType): JsonSchemaType { schema.type.includes("number") && schema.type.includes("null") ) { - return { ...schema, type: "number" }; + return { ...schema, type: "number", nullable: true }; } // Handle array type with exactly integer and null @@ -228,7 +228,7 @@ export function normalizeUnionType(schema: JsonSchemaType): JsonSchemaType { schema.type.includes("integer") && schema.type.includes("null") ) { - return { ...schema, type: "integer" }; + return { ...schema, type: "integer", nullable: true }; } return schema;